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
New Feature: Implements a modal to edit the Redirect plugin settings when needed #16844
New Feature: Implements a modal to edit the Redirect plugin settings when needed #16844
Conversation
…n settings when needed
@franz-wohlkoenig I can if you tell me which class I should be using :) |
i can't, i'm the one who ask;-) CSS-Gurus here? |
I have tested this item ✅ successfully on 4a8b5f8 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/16844. |
* @package Joomla.Administrator | ||
* @subpackage com_plugins | ||
* | ||
* @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2017
@roland-d Use the |
@roland-d other than the previouslt mentioned css issue its all good - thanks This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/16844. |
Changed reload of parent page
Thanks everybody for your input. I have made the following changes:
|
I have tested this item ✅ successfully on cb243fc This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/16844. |
@franz-wohlkoenig I could remove the label class and then it is just bold text. That just doesn't look clear enough to me that it is a link you can click. @Quy Any other options for styling this so it looks more like a clickable link? |
Improve the implementation of the |
Ok, I removed the label class. Declaring styling out of scope :) |
I have tested this item ✅ successfully on 6f1d7aa This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/16844. |
Can't we make this generic? I mean not specific to the redirect plugin? We could use the modal for other instances of editing a plugin when we have such situation: |
@infograf768 This was generic and then I made the mistake of putting that URL in there :P I will change this so it is generic. |
@infograf768 in Joomla4 we have events so this can be a lot nicer and of course not generic. Also this probably needs some attention when merging static to j4 (we don't have inline scripts anymore) |
else | ||
{ | ||
$link = JRoute::_('index.php?option=com_plugins&task=plugin.edit&extension_id=' . RedirectHelper::getRedirectPluginId()); | ||
$app->enqueueMessage(JText::sprintf('COM_REDIRECT_PLUGIN_DISABLED', $link), 'error'); | ||
$this->redirectPluginId = RedirectHelper::getRedirectPluginId(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since you already added the id
to JPluginHelper
db query return data, can't you just use JPluginHelper::getPlugin('system', 'redirect')->id
and remove/deprecate RedirectHelper::getRedirectPluginId
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You cannot do that because when the plugin is disabled the function will return an empty array.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right! Forget that
<?php | ||
if ($this->redirectPluginId) | ||
{ | ||
$link = JRoute::_('index.php?option=com_plugins&client_id=0&task=plugin.edit&extension_id=' . $this->redirectPluginId . '&tmpl=component&layout=modal'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why use &
in JRoute::_()?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No reason, just copy and paste :)
@roland-d please give a go if PR is ready for Test. |
@franz-wohlkoenig Let's ask @andrepereiradasilva if he wants anymore changes. If not, we can test. |
@franz-wohlkoenig Looks like we can test, @andrepereiradasilva has not raised any other issues. |
I have tested this item ✅ successfully on 6f5fc46 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/16844. |
|
||
if ($this->enabled && !$this->collect_urls_enabled) | ||
{ | ||
$app->enqueueMessage(JText::_('COM_REDIRECT_PLUGIN_ENABLED') . JText::sprintf('COM_REDIRECT_COLLECT_URLS_DISABLED', $link), 'notice'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a space between sentences.
@roland-d
|
hmm, still a small issue. |
Here it is:
this should work fine now. |
Thank you @infograf768 I have added the code verbatim as I don't have time to test it further at this moment but at least if it is all good others can test as well. |
I have tested this item ✅ successfully on fc25aa7 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/16844. |
I have tested this item ✅ successfully on fc25aa7 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/16844. |
RTC. Thanks! This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/16844. |
@rdeutz |
As its a new feature it should be 3.8 surely |
@roland-d I guess it is just an error. Please correct. |
@infograf768 That is a mistake, for some reason this thing keeps popping up. I don't think this file is even part of the core. I will fix this. |
fc25aa7
to
34dc757
Compare
it IS part of core ;) |
Looks like it solved itself, weird. |
@infograf768 Still part huh? :/ No, it didn't solve itself, I removed the previous commit and made a new commit. |
Then github is weird as, normally, a new commit would take off the RTC label... |
Needs to be synced with staging since the plugin helper class has now moved to its namespaced location (should just be able to |
* staging: (274 commits) Add JCryptCipherSodium to support libsodium (joomla#16754) Performance 2 (libraries/legacy) (joomla#12220) Performance 6 (templates) (joomla#12233) Fixed typehint (joomla#16425) Fix for: Repeatable field is no longer rendered with Chosen layout (joomla#16471) Fix the path for the ajax-loader.gif (joomla#16701) Menu items list parent filter (joomla#17060) Text Filters layout (joomla#17113) mod_login showon option (joomla#17153) com_banners incorret tooltip (joomla#17157) fix joomla.content.options_default (joomla#17123) remove the never working limitstart call (joomla#17184) Update phpDocumentor build set 3.8.0 Dev State Prepare 3.7.4 Stable Release fixed a logic change in joomla#12294, thanks @Hoffi1 Update sv-SE.ini Update pt-BR.ini Update lv-LV.ini Update fa-IR.ini ...
@mbabker Done as requested |
thank you |
Pull Request for Issue #7259
Summary of Changes
This is a redo of the original done at #7259 with some small code changes
Testing Instructions
When the plugin is disabled you will see this message:
When the plugin is disabled you will see this message:
I changed the regular link to a button so it is easier to see where to click.
7. Click on the Redirect System Plugin link and you are shown a modal in which you can change the settings. Update the settings and click Save.
8. The page is refreshed and the message has changed.
Expected result
I stay on the same page and can edit the settings.
Actual result
I am taking to a new page and need to navigate back.
Documentation Changes Required
None
Pinging @brianteeman @franz-wohlkoenig for testing :)