Conflicting Files ? Failure

User tests: Successful: 0 Unsuccessful: 0

avatar GeraintEdwards
GeraintEdwards
4 Dec 2017

Pull Request for Issue # .

Summary of Changes

The old Dynarch DHTML date picker had a setup option 'electric' which stopped the date input field from updating until a specific date was picked. This was not implement in the new joomla.calendar. This PR reinstates this functionality and adds support for it into JFormFieldCalendar

The reason its important is that calendar/event components will have javascript events triggered off changes in date fields - if these are changed spuriously as the date picker is navigated it can lead to unforseen/unplanned for outcomes such as date validation errors or incorrect data entry.

Testing Instructions

  1. Edit/create and article, go to the publishing tab and click the date picker button for the start date. Navigate the months and years and notice that the date picker field changes value. This is the 'electric; behaviour in action.

  2. Edit the file administrator/components/com_content/models/forms/article.xml and add

electric="false"

to the publish_up field at line c. 166 and repeat step 1.

  1. Edit the file administrator/components/com_content/models/forms/article.xml and add

electric="true"

to the publish_up field at line c. 166 and repeat step 1.

Expected result

  1. Date input field changes value as you navigate.

  2. Date input field does NOT change value as you navigate.

  3. Date input field changes value as you navigate.

Actual result

  1. Date input field changes value as you navigate.

  2. Date input field changes value as you navigate.

  3. Date input field changes value as you navigate.

In fact the joomla.calendar javascript has the 'electric' behaviour hard coded in.

Documentation Changes Required

Not sure if 'electric' is the best parameter name/description - its just that is what the old calendar used.

avatar GeraintEdwards GeraintEdwards - open - 4 Dec 2017
avatar GeraintEdwards GeraintEdwards - change - 4 Dec 2017
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 4 Dec 2017
Category Layout Libraries JavaScript
avatar GeraintEdwards GeraintEdwards - change - 4 Dec 2017
The description was changed
avatar GeraintEdwards GeraintEdwards - edited - 4 Dec 2017
avatar tonypartridge
tonypartridge - comment - 4 Dec 2017

@dgt41 @C-Lodder For your review pretty please :D

avatar C-Lodder
C-Lodder - comment - 4 Dec 2017

Shouldn't this just be the default functionality rather adding it as an option?

avatar GeraintEdwards
GeraintEdwards - comment - 4 Dec 2017

What I'm adding is the option to turn off the default functionality.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/18976.

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 8 Dec 2017

@C-Lodder should this PR be tested?


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/18976.

avatar C-Lodder
C-Lodder - comment - 8 Dec 2017

Yup I suppose it can be tested. @dgt41 calendar is your baby....you happy with this?

avatar dgrammatiko
dgrammatiko - comment - 8 Dec 2017

Haven't tested it, but code looks fine.

PS: not my baby, now it's our baby

avatar franz-wohlkoenig franz-wohlkoenig - test_item - 8 Dec 2017 - Tested unsuccessfully
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 8 Dec 2017

I have tested this item ? unsuccessfully on 4f82afb

With and -out PR: Changed administrator/components/com_content/models/forms/article.xml by appending electric="false" Date input Field changes value as navigating.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/18976.

avatar C-Lodder
C-Lodder - comment - 8 Dec 2017

Franz, copy the code from calendar.js to calendar.min.js or test in debug mode. The minified file wasnt commited :)

avatar dgrammatiko
dgrammatiko - comment - 8 Dec 2017

Can we please name this parameter something better than electric? This is confusing

avatar tonypartridge
tonypartridge - comment - 8 Dec 2017

@dgt41 it’s fixing a BC break so can’t really change it can we?

avatar franz-wohlkoenig franz-wohlkoenig - test_item - 8 Dec 2017 - Tested successfully
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 8 Dec 2017

I have tested this item successfully on 4f82afb

Changed given xml + applied PR:

  1. electric="false": Date input field does NOT change value as navigate.
  2. electric="true": Date input field changes value as navigate.

@C-Lodder Thanks for Help, Test by Debug-Mode.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/18976.
avatar C-Lodder
C-Lodder - comment - 8 Dec 2017

@GeraintEdwards, please could you commit the minified JS file?

avatar dgrammatiko
dgrammatiko - comment - 10 Dec 2017

it’s fixing a BC break so can’t really change it can we?

I'm not pointing at the js side but at the php were we didn't have this parameter. So the xml can have something more meaningful (if we can up with a better naming)...

avatar GeraintEdwards
GeraintEdwards - comment - 15 Dec 2017

What about "auto-update" instead of electric?

I agree wholeheartedly that "electric" is a rubbish descriptor and since it hasn't been used in the xml file before now its the right time to choose the better name.

avatar GeraintEdwards GeraintEdwards - change - 15 Dec 2017
Labels Added: ?
avatar laoneo
laoneo - comment - 21 Mar 2022

@GeraintEdwards sorry that it took so long to respond. Is this pr still valid for Joomla 3 or 4?

avatar laoneo
laoneo - comment - 4 Apr 2022

Had a look on the current J4 behavior and it still updates the input on navigation. So can you rebase this pr to the 4.2-dev branch as the calendar field got rewritten there? In the meantime I'm closing it, when ready please reopen. Thanks for your help making Joomla better.

Additional comment for maintainers, when #37456 got merged then this one here is not needed anymore as the native date input field doesn't update when the calendar is navigated.

avatar laoneo laoneo - close - 4 Apr 2022
avatar laoneo laoneo - change - 4 Apr 2022
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2022-04-04 07:48:21
Closed_By laoneo
Labels Added: Conflicting Files ?
Removed: ?

Add a Comment

Login with GitHub to post a comment