?
avatar hikashop-nicolas
hikashop-nicolas
1 Jun 2020

Steps to reproduce the issue

Add the code:
echo JHTML::_('calendar', '', 'name', 'id', '%d %B %Y %H:%M', array('size' => '20', 'showTime' => true));
at the beginning of the file administrator/components/com_content/tmpl/article/edit.php just after the line:
defined('_JEXEC') or die;
Then, create a new Joomla article

Expected result

A calendar field should appear at the top of the view (that's the code we used until now to display the calendar form in our component):
https://monosnap.com/file/wbgLGakcGgtLIrCDOq1Q8S547I9QXD

Actual result

The calendar field doesn't display the calendar when clicking on the button and a notice message appear:
https://monosnap.com/file/cyhd8P1ibyKz2Iu9tOI294heVyfCHO
"Notice : Undefined variable: dataAttribute in \layouts\joomla\form\field\calendar.php on line 117"

System information (as much as possible)

Clean Joomla 4 beta 1

Additional comments

Adding the line:
'dataAttribute' => '',
after the line:
'maxYear' => $maxYear,
in the file libraries/src/HTML/HTMLHelper.php fixes the problem but maybe there is a better way to fix it ? Or maybe another method should be used to load the calendar ?

avatar hikashop-nicolas hikashop-nicolas - open - 1 Jun 2020
avatar joomla-cms-bot joomla-cms-bot - change - 1 Jun 2020
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 1 Jun 2020
avatar Quy Quy - change - 2 Jun 2020
Status New Closed
Closed_Date 0000-00-00 00:00:00 2020-06-02 00:34:46
Closed_By Quy
avatar Quy Quy - close - 2 Jun 2020
avatar Quy
Quy - comment - 2 Jun 2020

Fixed in #29347.

Add a Comment

Login with GitHub to post a comment