Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

com_redirect modal close button check in fix #19116

Merged
merged 2 commits into from
Jan 3, 2018
Merged

com_redirect modal close button check in fix #19116

merged 2 commits into from
Jan 3, 2018

Conversation

Ruud68
Copy link
Contributor

@Ruud68 Ruud68 commented Dec 21, 2017

Pull Request for Issue # .

Summary of Changes

Changed the close button (footer) to execute the plugin.cancel task

Testing Instructions

  1. [tab 1]open com_redirect
  2. [tab 2] open second tab with com_plugins and filter on 'redirect' plugin
  3. in [tab 2] enable the redirect plugin and disable the collect urls > save the plugin
  4. in [tab 1] in com_redirect click the 'Redirect System Plugin' link in the notice
  5. clicking the [Close] button will close the modal

Expected result

The plg_system_redirect should be checked in

Actual result

The plg_system_redirect is NOT checked in.
in [tab 2] press ctrl-f5 and you can see that although the modal in tab 1 is closed, the plugin is not checked in correct.

Documentation Changes Required

none.

Note

this was previously fixed here: #18292 but unfortunately reintroduced with normalize patch: #18913

'height' => '400px',
'width' => '800px',
'bodyHeight' => '70',
'modalWidth' => '80',
'closeButton' => false,
'backdrop' => 'static',
'keyboard' => false,
'footer' => '<button class="btn" data-dismiss="modal" aria-hidden="true">'
. JText::_("JLIB_HTML_BEHAVIOR_CLOSE") . '</button>'
'footer' => '<button type="button" class="btn" data-dismiss="modal" aria-hidden="true"'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The other buttons don't have type="button". Can it be omitted?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Omitting the type defaults to type = submit.
Following the info provided by @brianteeman all three buttons should be of type = button because:

"The button has no default behavior. It can have client-side scripts associated with the element's events, which are triggered when the events occur."

The assumption I make here is that both the save and save & close buttons do not submit the form (then they should be of type=submit), but trigger jQuery script that does the checking and saving.

If the above is the way to go (all buttons type = button), then there are probably other areas where we can improve.

Can somebody confirm?

@Quy
Copy link
Contributor

Quy commented Dec 23, 2017

In the edit article modal, <a> is used instead of <button>. Maybe use <a> to be consistent.
article-edit-modal

@Ruud68
Copy link
Contributor Author

Ruud68 commented Dec 23, 2017 via email

@Quy
Copy link
Contributor

Quy commented Dec 24, 2017

I have tested this item ✅ successfully on 71bb5d9


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

@sandewt
Copy link
Contributor

sandewt commented Dec 25, 2017

I have tested this item ✅ successfully on 71bb5d9


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/19116.
Tested in: Firefox 57.0.3

@dgrammatiko
Copy link
Contributor

What I learned is that using the < a> in a form is wrong

The reason for A tag instead of BUTTON, which is the correct one, has to do with the stupid bootstrap modal script! To verify this go to the page with this modal and press enter (it doesn't matter which element has focus), the form will be submitted although it shouldn't. Now change the Button to A tags and retest, form will not submit!

This is a hack that is needed atm as we cannot change the Bootstrap 2.3.2 javascript!

@ghost
Copy link

ghost commented Dec 25, 2017

Ready to Commit after two successful tests.

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Dec 25, 2017
@dgrammatiko
Copy link
Contributor

@franz-wohlkoenig NO, the tags need to be converted to A for the reason I stated above. Please remove the RTC label

@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label Dec 25, 2017
@Ruud68
Copy link
Contributor Author

Ruud68 commented Dec 29, 2017

Hello @dgt41, just tried what you described: open the modal, press enter key.
The form stays open and doesn't close...
I think this is because on the form there is now NO button of type submit (all buttons are of type = 'button').
So I tested this successfully


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

@dgrammatiko
Copy link
Contributor

You need to test this with Firefox

@Ruud68
Copy link
Contributor Author

Ruud68 commented Dec 29, 2017

I am testing this with Firefox (Quantum): 57.0.3 (64-bit)
cannot reproduce the case you are describing: sorry :(


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

@sandewt
Copy link
Contributor

sandewt commented Dec 29, 2017

I have tested this item 🔴 unsuccessfully on 71bb5d9

This time a tested in Google Chrome 63.0.3239.108

Because here is it not a real issue, because I can not reproduce it !!!

See earlier test too.


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

I can not reproduce the case of @dgt41 in Firefox and Google Chrome.

@sandewt
Copy link
Contributor

sandewt commented Dec 29, 2017

@Ruud68 have you tested in Google Chrome (without the patch tester)? Result?
So not, can you test?

@Ruud68
Copy link
Contributor Author

Ruud68 commented Dec 30, 2017

Hi @sandewt I have just installed Google Chrome (Version 63.0.3239.108 (Official Build) (64-bit))
my patch works, and also the issue reported by @dgt41 regarding the closing of the modal when pressing the [enter] key: pressing the [enter] key does NOT close the modal (tested now on both Firefox and Chrome)

You tested unsuccessful, what is it that you tested? I am confused :)

@sandewt
Copy link
Contributor

sandewt commented Dec 30, 2017

Hi @Ruud68,

There is a misunderstanding.

I mean with unsuccessfull in Google Chrome that the plugin is (remains) checked in without and with the patch tester. So you don't need the patch tester!

I can't reproduce the case of @dgt41 in Firefox and Google Chrome.

Gr.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/19116.
Note: Tested in Firefox 57.0.3 successfull.

@Ruud68
Copy link
Contributor Author

Ruud68 commented Dec 31, 2017

Okay, retested everything both with FF and Chrome.

without patch:
Firefox has the issue that the plugin is not checked in when closing the modal window via the [close] button
Chrome does NOT have this issue: the modal is checked in correct (as found by @sandewt )
The issue reported by @dgt41 that pressing the enter key in the modal window closes the modal is NOT reproducible on both FF and Chrome.

with the patch applied:
Firefox checks in the modal CORRECT when closing the modal with the [close] button
Chrome checks in the modal CORRECT when closing the modal with the [close] button
Again: The issue reported by @dgt41 that pressing the enter key in the modal window closes the modal is NOT reproducible on both FF and Chrome.

So the issue raised by @dgt41 that blocks this patch from becoming RTC CANNOT be reproduced (at least by me and @sandewt ). I have tried to reproduce on both a clean install as on (multiple) production sites).

How to proceed?


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

@dgrammatiko
Copy link
Contributor

dgrammatiko commented Dec 31, 2017

@Ruud68 I raised the issue because I had to patch this couple of times in the past, if this is not an issue anymore then this is RTC!
Just to be clear here I was talking about #14483
@franz-wohlkoenig you can move this to RTC again

@ghost
Copy link

ghost commented Dec 31, 2017

Ready to Commit as stated above.

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Dec 31, 2017
@mbabker mbabker added this to the Joomla 3.8.4 milestone Jan 3, 2018
@mbabker mbabker merged commit 20424c4 into joomla:staging Jan 3, 2018
@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label Jan 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants