Conflicting Files NPM Resource Changed ? Pending

User tests: Successful: Unsuccessful:

avatar GeraintEdwards
GeraintEdwards
10 May 2021

…hEvent(new Event('change' - this ensures scripts that watch the input field using eventListeners and onchange attributes will respond to the event.

Pull Request for Issue # .

Summary of Changes

changes in calendar field javascript to mirror #33540 and #32756

Testing Instructions

  1. Testing onchange handler

edit the file administrator/components/com_content/forms/article.xml and find the publish_up field at line 129 and add the attrribute

onchange="alert(1);"

to this field and then edit an article and change the publish_up field (using the date picker)

  1. Testing change event listener

Add to Atum index.php before closing tag :


<script type="module">
if (window.jform_publish_up){
  window.jform_publish_up.addEventListener('change', () => {
    alert(2);
  })
}
</script>

Go to Article editing, and try to change the publish_up date.

Actual result BEFORE applying this Pull Request

You get a two alert(1) messages and one alert(2)

Expected result AFTER applying this Pull Request

You get one alert(1) message and alert(2)

Documentation Changes Required

avatar GeraintEdwards GeraintEdwards - open - 10 May 2021
avatar GeraintEdwards GeraintEdwards - change - 10 May 2021
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 10 May 2021
Category JavaScript Repository NPM Change
avatar GeraintEdwards GeraintEdwards - change - 10 May 2021
Labels Added: NPM Resource Changed ?
avatar richard67
richard67 - comment - 10 May 2021

@GeraintEdwards Your PR starts with a conflict in file build/media_source/system/js/fields/calendar.es5.js. Can it be that your 4.0-dev branch was outdated when you created that PR, or is that a while ago?

avatar GeraintEdwards
GeraintEdwards - comment - 10 May 2021

Thanks @richard67 - conflict resolved now. Don't know why by fetch upstream and merge didn't work first time!

avatar ceford
ceford - comment - 11 May 2021

Not sure I understand this one. I get two (1) alerts and on (2) alert with or without the patch. I have checked that npm run build:js gives the correct js output. I must have done something wrong in the test.


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

avatar Fedik Fedik - change - 11 May 2021
Title
switch usage of inputField.onchange in calendar fields to use dispatc…
[4.0] Switch usage of inputField.onchange in calendar fields to use dispatc…
avatar Fedik Fedik - edited - 11 May 2021
avatar GeraintEdwards GeraintEdwards - change - 11 May 2021
The description was changed
avatar GeraintEdwards GeraintEdwards - edited - 11 May 2021
avatar GeraintEdwards
GeraintEdwards - comment - 11 May 2021

@ceford

Not sure I understand this one. I get two (1) alerts and on (2) alert with or without the patch. I have checked that npm run build:js gives the correct js output. I must have done something wrong in the test.

My mistake this PR mirrored one from Joomla 3.9.x and I had initially miss-read the code and added a duplicated dispatchEvent call by mistake. I did correct the file about 5 hours ago - I don't know if you had tested the patch before then or if the patch tester has a delay on it??

I have amended the testing instructions too now.

avatar Fedik Fedik - test_item - 16 May 2021 - Tested successfully
avatar Fedik
Fedik - comment - 16 May 2021

I have tested this item successfully on d97b853


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

avatar GeraintEdwards GeraintEdwards - change - 17 Jun 2021
Labels Added: Conflicting Files
avatar GeraintEdwards
GeraintEdwards - comment - 17 Jun 2021

This PR can be closed since #5b54c98b762df1f342eb5c374cc7dff15d86bd3b on 22/05 merging in staging applied the same changes

avatar GeraintEdwards GeraintEdwards - change - 17 Jun 2021
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2021-06-17 11:39:06
Closed_By GeraintEdwards
avatar GeraintEdwards GeraintEdwards - close - 17 Jun 2021

Add a Comment

Login with GitHub to post a comment