-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Description
Steps to reproduce the issue
- Install Joomla 5.4.2
- Install an extension that uses the legacy Bootstrap tab helpers (e.g., ConvertForms, DPCalendar, Edocman, or JCE Editor)
- Access a page that renders tabs using these helpers
- Check PHP error logs
Expected result
No PHP warnings should be generated when using the Bootstrap or UiTab helpers.
Actual result
PHP Warning is generated:
PHP Warning: Undefined array key "Joomla\CMS\HTML\Helpers\Bootstrap::startTabSet" in Bootstrap.php on line 884
Similar issue exists in /libraries/src/HTML/Helpers/UiTab.php on line 92.
System information (as much as possible)
- Joomla Version: 5.4.2
- PHP Version: 8.1+ (warning appears with PHP 8+ strict error checking)
- Extensions triggering the issue: ConvertForms, DPCalendar, Edocman, JCE Editor
Additional comments
Root Cause:
Both Bootstrap.php (line 884) and UiTab.php (line 92) access array keys without checking if they exist:
$active = (static::$loaded[__CLASS__ . '::startTabSet'][$selector]['active'] == $id) ? ' active' : '';
Proposed Fix:
Add isset() check before accessing the array:
$active = (isset(static::$loaded[__CLASS__ . '::startTabSet'][$selector]['active']) && static::$loaded[__CLASS__ . '::startTabSet'][$selector]['active'] == $id) ? ' active' : '';
This defensive programming approach prevents warnings when extensions call addTab() but the initialization in startTabSet() didn't complete properly or the array key doesn't exist.
Files affected:
- Bootstrap.ph line 884
- UiTab.php line 92