[TikiWiki-commits] [Git][tikiwiki/tiki][30.x] [FIX] Fix maxWidth form handling in file gallery page view

"Baraka Kinywa \(@bkinywa24\) via TikiWiki-cvs" <[email protected]>
Newsgroups gmane.comp.cms.tiki.cvs
Message-ID <69e3f22c76eac_3b4aeb934257c3@gitlab-sidekiq-low-urgency-cpu-bound-v2-5cf6b587c7-svtgs.mail>

Baraka Kinywa pushed to branch 30.x at Tiki Wiki CMS Groupware / Tiki


Commits:
81188507 by Espoir Baraka at 2026-04-18T23:57:55+03:00
[FIX] Fix maxWidth form handling in file gallery page view
---
* [FIX] Fix maxWidth form handling in file gallery page view
---
* [FIX] Fix maxWidth form handling in file gallery page view

See merge request tikiwiki/tiki!9368

(cherry picked from commit 3881ee8305045df476dd30fa6d1afc46343cf4df)

See merge request tikiwiki/tiki!10039

- - - - -


3 changed files:

- templates/fgal_thumbnailframe.tpl
- templates/tiki-list_file_gallery.tpl
- tiki-list_file_gallery.php


Changes:

=====================================
templates/fgal_thumbnailframe.tpl
=====================================
@@ -45,7 +45,7 @@
                     {if $key_type neq 'image/svg' and $key_type neq 'image/svg+xml'}
                         {if $imagetypes eq 'y' or $prefs.theme_iconset eq 'legacy'}
                             {if $view eq 'page'}
-                                <img src="tiki-download_file.php?fileId={$file.id}&preview" style="width:{$maxWidth};max-width: 100%;">
+                                <img src="tiki-download_file.php?fileId={$file.id}&preview" style="width:{$maxWidth}px;max-width: 100%;">
                             {else}
                                 <img src="{$file.id|sefurl:thumbnail}" style="max-height:{$thumbnailcontener_size}px">
                             {/if}


=====================================
templates/tiki-list_file_gallery.tpl
=====================================
@@ -296,7 +296,7 @@
                 <div class="row col-sm-3">
                     <label for="maxWidth" class="col-form-label">{tr}Maximum width{/tr}</label>
                     <div class="input-group col-sm-2">
-                        <input id="maxWidth" class="form-control" type="number" name="maxWidth" value="{$maxWidth|substr:0:-2}">
+                        <input id="maxWidth" class="form-control" type="number" name="maxWidth" value="{$maxWidth}">
                         <span class="input-group-text">{tr}pixels{/tr}</span>
                     </div>
                 </div>


=====================================
tiki-list_file_gallery.php
=====================================
@@ -1272,7 +1272,11 @@ if (isset($_GET['slideshow'])) {
             }
         }
         if ($view == 'page') {
-            $smarty->assign('maxWidth', $_REQUEST['maxWidth'] ?? '300px');
+            $maxWidth = (int)($_REQUEST['maxWidth'] ?? 300);
+            if ($maxWidth <= 0) {
+                $maxWidth = 300;
+            }
+            $smarty->assign('maxWidth', $maxWidth);
             $smarty->assign('maxRecords', 1);
             $smarty->assign(
                 'metarray',



View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/81188507d5b26acd51ec0b8268e712081afb422c

-- 
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/81188507d5b26acd51ec0b8268e712081afb422c
You're receiving this email because of your account on gitlab.com. Manage all notifications: https://gitlab.com/-/profile/notifications | Help: https://gitlab.com/help

_______________________________________________
TikiWiki-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tikiwiki-cvs
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.