-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Display a warning whenever an menu item's alias has changed #13856
Conversation
@marrouchi great minds think a like ;-) I just created an issue today about this issue #13851 I was thinking of going one step further and auto-creating the redirect if a user wishes. I'll run some tests on this. |
@tonypartridge Yes i saw your issue and i've coded a PR right away :) |
@marrouchi I am just wondering if a plugin is needed. Can we not just adjust the com_menus component? Since the plugin is called on every save when it is only needed on a menu item save. |
I thought of this approach would be better to keep the menu item controller clean, since this feature is related to two components (com_menus & com_redirect). |
I see your point completely, but it's then a plugin which is also then still requires both components. But both components ship with the core. @zero-24 @mbabker what are your thoughts on this? I was thinking of checking if com_redirects plugin is enabled and if so basically doing what Marrouchi has done. But within the component controller opposed to a plugin? |
Why not throw it in the existing redirect plugin? The notice seems like a good idea to me and that plugin already has to be active to make use of the system, so... |
Duhh good idea! @mbabker @marrouchi do you want to do the changes? |
Yes good idead ! Should i create a new PR ? |
I don't think so? Just remove this plugin from your GIT and add the changes to the system and push your changes they should come through for us to review again. |
One should only get a message or action link (whatever) if sef is enabled. |
I disagree re see as some people might disable it on testing environments when doing something or other. But an option to disable it is a good idea.
…On 2 Feb 2017, 16:14 +0000, bertmert ***@***.***>, wrote:
One should only get a message or action link (whatever) if sef is enabled.
And there should be an option in the plugin to deactivate this feature completely, please. Because of other extensions that also deal with aliases.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub (#13856 (comment)), or mute the thread (https://github.com/notifications/unsubscribe-auth/ABVglvCy8DrGyuHBsTeH68yfez9HNSaZks5rYgDAgaJpZM4L1Pd0).
|
5925236
to
61189b3
Compare
… updated (using the redirect plugin).
Done ! I've added a enable/disable button of this features in the redirect plugin config form. Ready to test 👍 |
I have tested this item 🔴 unsuccessfully on 429b80d Not working Point 4: Using old Url get redirected on Homepage. Using modern Router. Another Point: If User have Redirect-Plugin disabled, they got no Hint. This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/13856. |
@franz-wohlkoenig This PR does not alter the redirection mechanism. Redirection does not seem to work when modern routing is enabled and that's an new issue that must be addressed. To confirm this, please revert the patch and try a redirection when having modern routing enabled. |
Test on legacy Router, Plugin "Redirect" enabled. Got on Point 4 (using old alias Test on:Joomla! 3.7.0-beta1 |
Can you look at resolving the conflicts so that this can be tested please. |
I have tested this item 🔴 unsuccessfully on b9ac171 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/13856. |
I have tested this item 🔴 unsuccessfully on b9ac171 0 Using $this when not in object context @YEMETIO if you restest later open the plugin and save the settings This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/13856. |
I have tested this item ✅ successfully on b9ac171 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/13856. |
2 similar comments
I have tested this item ✅ successfully on b9ac171 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/13856. |
I have tested this item ✅ successfully on b9ac171 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/13856. |
Ready to Commit after two successful tests considering 2 unsuccessful tests so Maintainers have to decide (as always). |
I have tested this item 🔴 unsuccessfully on b9ac171 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/13856. |
please remove the rtc status |
Removed RTC This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/13856. |
I have tested this item 🔴 unsuccessfully on b9ac171 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/13856. |
@marrouchi
|
* @return boolean true if function not enabled, is in frontend or is new. Else true or | ||
* false depending on success of save function. | ||
* | ||
* @since 1.6 |
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.
Change to __DEPLOY_VERSION__
* | ||
* @return boolean | ||
* | ||
* @since 1.6 |
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.
Change to __DEPLOY_VERSION__
{ | ||
if (!($form instanceof JForm)) | ||
{ | ||
$this->_subject->setError('JERROR_NOT_A_FORM'); |
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.
Missing language string
{ | ||
if (!$isNew && $context == 'com_menus.item' && $this->params->get('watch_alias')) | ||
{ | ||
$menu = & JSite::getMenu(); |
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.
Please change this line to
$menu = (new \Joomla\CMS\Application\SiteApplication)->getMenu();
to make the PR work.
Hi @marrouchi, as this is a new feature it will not go into J3.x series because of the feature freeze. Also it seams it doesn't work (4 failing tests). Thx for your work and time you invested into Joomla! I'm closing this PR and hope you find time to create a new one for J4. |
Display a warning message whenever a menu item's alias has been updated. The message suggests to the admin user to create a new redirection to the old alias in order to avoid 404 errors from existing urls.
Pull Request for Issue #13851.
Summary of Changes
old_url
&new_url
Watch Alias
) has been added to the plugin config form if there's need a disable this feature.Testing Instructions
First, make sure that the redirect plugin is enabled.
When enabled :
old_url
&new_url
filled with default values. Hit the Save button.When disabled :
Watch Alias
Documentation Changes Required
No.