?
avatar nikosdion
nikosdion
31 May 2020

What needs to be fixed

Let's say you want to display a date picker (calendar) in Joomla 4.0.0.b1. As per usual you do:

echo \Joomla\CMS\HTML\HTMLHelper::('calendar', $myDate, 'fieldName', 'fieldID');

You'd expect to see a Calendar field. However, if error reporting is set to Maximum you are met with a nasty PHP Notice "Notice: Undefined variable: dataAttribute in ...../layouts/joomla/form/field/calendar.php on line 117" This breaks the display and the calendar field.

Why this should be fixed

Because it breaks all of my software where a date needs to be selected and I don't wanna have to implement my own date picker.

How would you fix it

Change this https://github.com/joomla/joomla-cms/blob/4.0-dev/layouts/joomla/form/field/calendar.php#L117

to that:

<?php echo $dataAttribute ?? ''; ?>

Side Effects expected

None.

avatar nikosdion nikosdion - open - 31 May 2020
avatar joomla-cms-bot joomla-cms-bot - change - 31 May 2020
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 31 May 2020
avatar brianteeman
brianteeman - comment - 31 May 2020

For reference this was merged without tests #29252

avatar nikosdion
nikosdion - comment - 31 May 2020

@brianteeman Thanks! I had tested this on Thursday and I was so confused as to why it suddenly broken over the weekend. Sucks that I'm using it with all of my software which I plan to release officially J4 compatible versions for in the next 10 days :/ At least if it's fixed it won't appear that I'm doing something wrong.

avatar brianteeman
brianteeman - comment - 31 May 2020

Well you know the quick way to get it fixed ;)

I don't understand that code so I would be working blind

avatar nikosdion
nikosdion - comment - 31 May 2020

Done :)

avatar alikon
alikon - comment - 31 May 2020

closed as we have #29347

avatar alikon alikon - change - 31 May 2020
Status New Closed
Closed_Date 0000-00-00 00:00:00 2020-05-31 19:19:01
Closed_By alikon
avatar alikon alikon - close - 31 May 2020

Add a Comment

Login with GitHub to post a comment