giterlizzi / dokuwiki-template-bootstrap3

Bootstrap-based template for DokuWiki
https://dokuwiki.org/template:bootstrap3
GNU General Public License v2.0
220 stars 77 forks source link

Template style settings: colour boxes extremely narrow and php warnings #583

Closed ggieling closed 3 weeks ago

ggieling commented 1 year ago

Description

1) The colour boxes <input type="color" name="tpl[__text__]" id="tpl____text__" ...> in the template style settings in dokuwiki are extremely narrow when working in the bootstrap3 template. 2) The template style settings page shows warning messages. When opening the settings page in the wiki the below message appears below the colour boxes area. Warning: Trying to access array offset on value of type null in /srv/http/won1/content/inc/parserutils.php on line 151 After opening as popup additional warnings appear above the coulor boxes area. Warning: Trying to access array offset on value of type null in /srv/http/won1/content/inc/toolbar.php on line 270 (twice) Warning: Trying to access array offset on value of type null in /srv/http/won1/content/inc/toolbar.php on line 271 (twice)

Steps to reproduce

  1. install bootstrap3 addon
  2. activate bootstrap3 addon
  3. goto admin -> Template Style Settings

Steps to solve

  1. revert to dokuwiki template

I expected the colour boxes to be visible in standard size as in the default dokuwiki template (box size 54x22) and the page to not display any warnings

colour boxes are extremely narrow (box size 3x20) and the warnings appear

Versions

Screenshots or Logs

[Paste your logs or attach the screenshot]

Sample page or snippet

[Paste your sample DokuWiki page or snippet using MarkDown code syntax]

Er4twXz commented 1 year ago

This can be fixed by excluding inputs of type color from getting the form-control class

C:\server\Apache24\htdocs\dokuwiki\lib\tpl\bootstrap3\script.js line 144 jQuery('input, select, textarea') .not('[type=submit], [type=reset], [type=button], [type=hidden], [type=image], [type=checkbox], [type=radio], [type=color]')

C:\server\Apache24\htdocs\dokuwiki\lib\tpl\bootstrap3\Template.php line 1502 if (!in_array($elm->type, ['submit', 'reset', 'button', 'hidden', 'image', 'checkbox', 'radio', 'color'])) { $elm->class .= ' form-control';

I had to clear the cache C:\server\Apache24\htdocs\dokuwiki\data but I don't know whether its needed

giterlizzi commented 3 weeks ago

Fixed in master branch.

Thank you for the patch suggestion!