? ? Failure

User tests: Successful: Unsuccessful:

avatar marrouchi
marrouchi
2 Feb 2017

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

  1. Added two methods to the redirect plugin:
  • onContentbeforeSave : Check if the menu item's alias has changed. If it's the case, then display a warning message that suggests to the admin user to create a redirection to the old alias.
  • onContentPrepareForm : Alter menu item edit form whenever there's GET params (old_alias & new_alias) in order to set default values for the fields old_url & new_url
  1. An enable/disable field (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 :

  1. Edit an existing menu item and change the alias. Then hit the Save button.
  2. A warning message should be displayed that says : "You should create a new redirection to avoid 404 errors that could be generated by the old alias's urls : Create a new redirection"
  3. Click on the link Create a new redirection and you should be redirected to a new redirection form with the two fields old_url & new_url filled with default values. Hit the Save button.
  4. Access the old URL in frontend (that uses the old alias) and you should be redirected to the new one.

When disabled :

  1. Go the redirect plugin config form and disable Watch Alias
  2. Back to the menu manager, Edit an existing menu item and change the alias. Then hit the Save button.
  3. There will be no warning message.

Documentation Changes Required

No.

avatar marrouchi marrouchi - open - 2 Feb 2017
avatar marrouchi marrouchi - change - 2 Feb 2017
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 2 Feb 2017
Category Administration Language & Strings SQL Installation Postgresql MS SQL Front End Plugins
avatar tonypartridge
tonypartridge - comment - 2 Feb 2017

@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.

avatar marrouchi
marrouchi - comment - 2 Feb 2017

@tonypartridge Yes i saw your issue and i've coded a PR right away :)

avatar marrouchi marrouchi - edited - 2 Feb 2017
avatar tonypartridge
tonypartridge - comment - 2 Feb 2017

@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.

avatar marrouchi
marrouchi - comment - 2 Feb 2017

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).

avatar tonypartridge
tonypartridge - comment - 2 Feb 2017

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?

avatar mbabker
mbabker - comment - 2 Feb 2017

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...

avatar tonypartridge
tonypartridge - comment - 2 Feb 2017

Duhh good idea! @mbabker

@marrouchi do you want to do the changes?

avatar marrouchi
marrouchi - comment - 2 Feb 2017

Yes good idead ! Should i create a new PR ?

avatar tonypartridge
tonypartridge - comment - 2 Feb 2017

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.

avatar ghost
ghost - comment - 2 Feb 2017

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.

avatar tonypartridge
tonypartridge - comment - 2 Feb 2017

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 notifications@github.com, 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).

avatar marrouchi marrouchi - change - 2 Feb 2017
Title
[imp] New plugin that displays a warning whenever an menu item's has changed
[imp] New plugin that displays a warning whenever an menu item's alias has changed
Labels Added: ? ?
avatar marrouchi marrouchi - change - 2 Feb 2017
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2017-02-02 17:06:39
Closed_By marrouchi
avatar marrouchi marrouchi - close - 2 Feb 2017
avatar marrouchi marrouchi - close - 2 Feb 2017
avatar joomla-cms-bot joomla-cms-bot - change - 2 Feb 2017
Category Administration Language & Strings SQL Installation Postgresql MS SQL Front End Plugins
avatar marrouchi marrouchi - change - 2 Feb 2017
Labels Removed: ?
avatar marrouchi marrouchi - change - 2 Feb 2017
Status Closed New
Closed_Date 2017-02-02 17:06:39
Closed_By marrouchi
avatar marrouchi marrouchi - change - 2 Feb 2017
Status New Pending
avatar marrouchi marrouchi - reopen - 2 Feb 2017
avatar joomla-cms-bot joomla-cms-bot - change - 2 Feb 2017
Category Front End Plugins
avatar joomla-cms-bot joomla-cms-bot - change - 2 Feb 2017
Category Front End Plugins Administration Language & Strings Front End Plugins
avatar marrouchi
marrouchi - comment - 2 Feb 2017

Done ! I've added a enable/disable button of this features in the redirect plugin config form.

Ready to test 👍

avatar marrouchi marrouchi - change - 2 Feb 2017
Title
[imp] New plugin that displays a warning whenever an menu item's alias has changed
[imp] Display a warning whenever an menu item's alias has changed
avatar marrouchi marrouchi - edited - 2 Feb 2017
avatar marrouchi marrouchi - change - 2 Feb 2017
The description was changed
avatar marrouchi marrouchi - edited - 2 Feb 2017
avatar marrouchi marrouchi - change - 2 Feb 2017
The description was changed
avatar marrouchi marrouchi - edited - 2 Feb 2017
avatar marrouchi marrouchi - change - 2 Feb 2017
The description was changed
avatar marrouchi marrouchi - edited - 2 Feb 2017
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 2 Feb 2017

I have tested this item 🔴 unsuccessfully on 429b80d

Point 1-3 of Testing Instructions works.

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.
avatar franz-wohlkoenig franz-wohlkoenig - test_item - 2 Feb 2017 - Tested unsuccessfully
avatar marrouchi
marrouchi - comment - 2 Feb 2017

@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.

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 4 Feb 2017

Test on legacy Router, Plugin "Redirect" enabled.

Got on Point 4 (using old alias using-joomla) a 404 Category not found. Category is enabled, in Plugin is a new, disabled Link index.php/using-joomla without new URL.

Test on:

Joomla! 3.7.0-beta1
macOS Sierra, 10.12.3
Firefox 50.1.0
PHP 7.0.4
MySQLi 5.5.53-0

avatar rdeutz rdeutz - change - 27 May 2017
Labels Added: ?
avatar brianteeman
brianteeman - comment - 9 Sep 2017

Can you look at resolving the conflicts so that this can be tested please.

avatar Yemetio Yemetio - test_item - 23 Jul 2018 - Tested unsuccessfully
avatar raoulyemetio
raoulyemetio - comment - 23 Jul 2018

I have tested this item 🔴 unsuccessfully on b9ac171

I apply the patch, watch alias was enabled
then i changed an existing menu item
but i got no warning message
@icampus


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

avatar coolcat-creations coolcat-creations - test_item - 23 Jul 2018 - Tested unsuccessfully
avatar coolcat-creations
coolcat-creations - comment - 23 Jul 2018

I have tested this item 🔴 unsuccessfully on b9ac171

I would love to have this feature, but i had an error on testing.

0 Using $this when not in object context
/Applications/MAMP/htdocs/joomla-cms/libraries/src/Application/CMSApplication.php:369

@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.

avatar fatmaakay fatmaakay - test_item - 23 Jul 2018 - Tested successfully
avatar fatmaakay
fatmaakay - comment - 23 Jul 2018

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.

avatar fatmaakay fatmaakay - test_item - 23 Jul 2018 - Tested successfully
avatar fatmaakay
fatmaakay - comment - 23 Jul 2018

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.

avatar durubayram durubayram - test_item - 23 Jul 2018 - Tested successfully
avatar durubayram
durubayram - comment - 23 Jul 2018

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.

avatar franz-wohlkoenig franz-wohlkoenig - change - 23 Jul 2018
Status Pending Ready to Commit
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 23 Jul 2018

Ready to Commit after two successful tests considering 2 unsuccessful tests so Maintainers have to decide (as always).

avatar durubayram durubayram - test_item - 23 Jul 2018 - Tested unsuccessfully
avatar durubayram
durubayram - comment - 23 Jul 2018

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.

avatar brianteeman
brianteeman - comment - 23 Jul 2018

please remove the rtc status

avatar Quy Quy - change - 23 Jul 2018
Status Ready to Commit Pending
avatar Quy
Quy - comment - 23 Jul 2018

Removed RTC


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

avatar fatmaakay fatmaakay - test_item - 23 Jul 2018 - Tested unsuccessfully
avatar fatmaakay
fatmaakay - comment - 23 Jul 2018

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.

avatar coolcat-creations
coolcat-creations - comment - 23 Jul 2018

@marrouchi
Can you change the Line I reviewed, and fix the Code Style for 3.8 ?

  • Would be great to have this watcher also on trashing and on unpublishing the item.
    Thank you for this great addition.
avatar franz-wohlkoenig franz-wohlkoenig - change - 11 Apr 2019
Category Front End Plugins Administration Language & Strings Administration Front End Plugins
avatar franz-wohlkoenig franz-wohlkoenig - change - 19 Apr 2019
Title
[imp] Display a warning whenever an menu item's alias has changed
Display a warning whenever an menu item's alias has changed
avatar franz-wohlkoenig franz-wohlkoenig - edited - 19 Apr 2019
avatar joomla-cms-bot joomla-cms-bot - change - 19 Apr 2019
Category Front End Plugins Administration Administration Language & Strings Front End Plugins
avatar HLeithner
HLeithner - comment - 30 Jun 2019

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).
If you still interested to bring this feature into Joomla please rebase the PR on J4 branch and correct the reported errors.

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.

avatar HLeithner HLeithner - change - 30 Jun 2019
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2019-06-30 22:59:53
Closed_By HLeithner
Labels Removed: J3 Issue
avatar HLeithner HLeithner - close - 30 Jun 2019

Add a Comment

Login with GitHub to post a comment