User tests: Successful: Unsuccessful:
Pull Request for Issue # #18285
set backdrop to static, disable (X) button and disable keyboard outside modal to prevent closing modal without executing the close logic.
Changed the close button (footer) to execute the plugin.cancel task
The plg_system_redirect should be checked in
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.
With patch applied:
not that I know of.
Category | ⇒ | Administration com_redirect |
Status | New | ⇒ | Pending |
Hi, been testing and trying that yesterday. Run into the same issue that the save button when added closes the modal.
This is because (my best guess) the save function does a post of the form and a post closes the modal.
I have not sufficient javascript / jquery knowledge to fix that: that is the reason why I left it out in the first place.
So in short: help needed :)
Also, I guess we do need to add a conditional
if ($user->authorise('core.edit', 'com_plugins')) etc.
Agree but I think that (authorization check and Apply button) are out of scope for this commit which addresses the incorrect close behavior.
@franz-wohlkoenig true, it enables the plugin, but that is not what this fix is fixing. It fixes the ability to close the modal and by doing that bypassing the proper close function: the plugin is checked out. That means that another administrator cannot handle it anymore
If in that Scenario in Tab 1 the Redirect-Plugin is enabled even "Close" is used in Modal its a successfully Test?
Hi, let me explain with video: https://office.onlinecommunityhub.nl/nextcloud/s/Aa94YsNtXY377vB
After my patch:
1, close button > plugin correctly checked in
2. X > not possible (there is no X)
3. click on backdrop: disabled
4. click save and close > same as before
@Ruud68 another way to solve this without removing the X button and forcing the backdrop is to setup a listener for the Bootstrap Modal hide event and then click on the cancel button on the modal Iframe. Something like:
$doc->addScriptDeclaration(
"jQuery('#plugin" . $this->redirectPluginId . "Modal').on('bs.modal.hide', function(e) {
jQuery('#plugin" . $this->redirectPluginId . "Modal iframe').contents().find('#closeBtn').click();
});"
);
I have tested this item
Thanks for Patience, @Ruud68
@franz-wohlkoenig Top!
Now waiting patiently for second test :)
@infograf768 do you have Time for 2nd Test?
To be normalized (even if we can't add Apply), the code still needs imho to be modified to get
+ 'height' => '400px',
+ 'width' => '800px',
+ 'bodyHeight' => '70',
+ 'modalWidth' => '80',
+ 'closeButton' => false,
+ 'backdrop' => 'static',
+ 'keyboard' => false,
etc.
Hi, as said before: this change is not about normalizing, but is a fix for a bug.
I agree that things need to be normalized, but that would then need investigation of what normal is, and things need to be tested on multiple devices (how do the height and width that are put here as an example behave on mobile devices, etc.
For me that is (way) beyond the scope of this 'quick' fix and should be addressed in a separate PR... or not :S
While correcting a bug, if code has to be normalized at the same time, one should do it instead of creating a new PR. Cost is little and saves time for testers.
See
https://github.com/joomla/joomla-cms/blob/staging/administrator/components/com_content/models/fields/modal/article.php#L197-L218
@infograf768 agree, but... that code limits the usage on mobile devices, so normalizing would not be an option for me. The way to go when normalizing is that it is normalized so that it will work cross device.
That (for me) is no little cost as that would involve looking at all modal code and all use cases / devices.
Anyway, the whole discussion regarding this simple patch (mind you, my first step to becoming a contributer) is taking so much time and attention that I could have normalized all modal code.
That is why I now stop putting time in this PR: feel free to test or not.
I have tested this item
I don't want to discourage you. Maintainers will decide. Test OK here.
Status | Pending | ⇒ | Ready to Commit |
Ready to Commit after two successful tests.
Status | Ready to Commit | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2017-11-19 13:06:46 |
Closed_By | ⇒ | mbabker | |
Labels |
Added:
?
|
@infograf768 Here you go: normalized and save (apply) button :)
#18913
While testing this, I tried to normalise further that modal by adding a Save (apply) button, but it fails, i.e. Save also closes the modal.
Here is my patch. Can you look at what is missing?