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

Benoit Grégoire (@benoitg) via TikiWiki-cvs <[email protected]>
Newsgroups gmane.comp.cms.tiki.cvs
Message-ID <69e232f3f721_3b18df6c94686@gitlab-sidekiq-low-urgency-cpu-bound-v2-6964f6fdb5-bcddq.mail>

Benoit Grégoire pushed to branch master at Tiki Wiki CMS Groupware / Tiki


Commits:
3881ee83 by Espoir Baraka at 2026-04-17T13:09:34+00:00
[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

- - - - -


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
=====================================
@@ -1277,7 +1277,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/3881ee8305045df476dd30fa6d1afc46343cf4df

-- 
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/3881ee8305045df476dd30fa6d1afc46343cf4df
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.