User tests: Successful: Unsuccessful:
Closes gh-29340
Pull Request for Issue #29340 .
Fixes https://github.com/joomla/joomla-cms/blob/4.0-dev/layouts/joomla/form/field/calendar.php#L117 to stop emitting a PHP Notice when you display a Calendar field with HtmlHelper.
Set error reporting to Maximum.
Use any extension which uses something similar to
echo \Joomla\CMS\HTML\HTMLHelper::('calendar', $myDate, 'fieldName', 'fieldID');
such as Akeeba Backup Core, Manage Backups tab.
Calendar (date picker) fields displayed without an issue.
You see "Notice: Undefined variable: dataAttribute in ...../layouts/joomla/form/field/calendar.php on line 117" in the middle of the calendar field. The effect is more pronounced and disruptive if you have XDebug enabled.
None.
Status | New | ⇒ | Pending |
Category | ⇒ | Layout |
get someone to review all the HTML helpers for the missing data attribute code. This will be the case not only for the calendar
Just did a review this is the only place we seem to be calling one of the form fields layouts.
Just to cover all aspects I've directly pushed a change fixing this in the HTMLHelper too tho with 4500d21
Status | Pending | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2020-05-31 20:55:03 |
Closed_By | ⇒ | wilsonge | |
Labels |
Added:
?
|
Thanks!
@nikosdion although your code will solve the undefined variable error probably is not solving the root problem which is the parent function doesn't spit that variable. I guess a more robust approach is to add also the data-attributes part here
joomla-cms/libraries/src/HTML/HTMLHelper.php
Lines 1024 to 1046 in fa48ef9
@wilsone get someone to review all the HTML helpers for the missing data attribute code. This will be the case not only for the calendar