? ? Success

User tests: Successful: Unsuccessful:

avatar asika32764
asika32764
28 Jun 2017

Summary of Changes

Modify JComponentRouterRulesStandard add $query['id'] into isset() so this build rule will not error if id not exists.

Testing Instructions

In a plugin onAfterInitialise event, set JComponentHelper::getParams('com_content')->set('sef_advanced', 1);

Add JRoute::_('option=com_content&view=category') without id after above code.

Then go to a category view page.

Expected result

JRoute should return a wrong URL not error message.

Actual result

Get Undefined index: id error.


We shouldn't make it error, just return NULL to let next rule build a new URL.

If someone want to notice developer who uses a wrong route query, they should throw Exception in router class, maybe getCategorySegment() or other positions.

avatar asika32764 asika32764 - open - 28 Jun 2017
avatar asika32764 asika32764 - change - 28 Jun 2017
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 28 Jun 2017
Category Libraries
avatar asika32764 asika32764 - change - 28 Jun 2017
The description was changed
avatar asika32764 asika32764 - edited - 28 Jun 2017
avatar asika32764 asika32764 - change - 28 Jun 2017
The description was changed
avatar asika32764 asika32764 - edited - 28 Jun 2017
avatar asika32764 asika32764 - change - 28 Jun 2017
The description was changed
avatar asika32764 asika32764 - edited - 28 Jun 2017
avatar asika32764 asika32764 - change - 28 Jun 2017
The description was changed
avatar asika32764 asika32764 - edited - 28 Jun 2017
avatar asika32764 asika32764 - change - 28 Jun 2017
The description was changed
avatar asika32764 asika32764 - edited - 28 Jun 2017
avatar asika32764 asika32764 - change - 28 Jun 2017
The description was changed
avatar asika32764 asika32764 - edited - 28 Jun 2017
avatar wilsonge
wilsonge - comment - 28 Jun 2017
avatar Hackwar
Hackwar - comment - 28 Jun 2017

? Looks good.

avatar wilsonge wilsonge - test_item - 20 Jul 2017 - Tested successfully
avatar wilsonge
wilsonge - comment - 20 Jul 2017

I have tested this item successfully on 10f591e

I reproduced this by creating a "Submit Article" form and putting it's menu item as a child a category blog menu item. Then creating a new article in the blog with the same alias as the menu item. This ended up giving me the same error, and this patch fixed it.


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

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 24 Jul 2017

@wilsonge

This Test-Enviroment you use?

  1. Blog-Menu using Alias "example"
  2. as Child of Blog-Menu a "Submit Article"-Menu
  3. create an Article using Alias "example"

this ended in an Undefined index: id, this PR solves it … correct?

avatar wilsonge
wilsonge - comment - 24 Jul 2017

No create a child article with the same alias as the "submit article" menu item

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 24 Jul 2017

Parent-Menu "Blog" (Category Blog),
|- Child-Menu "Test" (Create Article),

created an Article in Frontend using "Test"-Menu, got:

1

Click on Article got:

2

What i'm missing?

avatar asika32764
asika32764 - comment - 24 Jul 2017

This issue will occurred in a view without id var. Just paste the example code will reproduce this issue.

Mostly this error will not appear in com_content but if any developer use new route in their own component, this error in library will make them hard to debug.

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 24 Jul 2017

@asika32764 thanks for Info. So its an issue to test for Devs.

avatar wilsonge
wilsonge - comment - 24 Jul 2017

@franz-wohlkoenig whoops i forgot to add that you need to have new routing on. So either test on 3.8 with that param enabled. Or store with the com_content params no id's and new router mode enabled

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 26 Jul 2017

Test on 3.8-dev using new Router, no ID.

Without PR got no Warning after saving Article. Click on Article in Blog-View call "Create Article"-Menu.

Applying Patch got: The file marked for modification does not exist: libraries/cms/component/router/rules/standard.php

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 26 Jul 2017

Patch applied, same Result: Click on Article (Alias "test") in Blog-View open "Create Article"-Menu (Alias "test").

avatar wilsonge
wilsonge - comment - 26 Jul 2017
  1. Apply Patch
  2. Install Joomla with sample data
  3. Move "Submit Article" menu item to be a child of "Article Category Blog"
  4. Create an article in the "Park Blog" category with the alias "submit-article" (note the category is the one that matches the category blog menu item and the alias matches the child menu item).
  5. Turn on "Experimental Routing" and "no Id's" for com_content
  6. Go to the frontend and go to the 'submit article' menu item. You'll find beneath the article submission there's a PHP Notice

image

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 26 Jul 2017

Article "Submit Article", Category "Park Blog", Blog-View:

bildschirmfoto 2017-07-26 um 12 22 06

Open Article opens Menu "Submit Article", no Notice. Error Reporting "Development".

bildschirmfoto 2017-07-26 um 12 22 37

System information

3.8-dev
Multilanguage Site
macOS Sierra, 10.12.5
Firefox 54 (64-bit)

MAMP 4.1.1

  • PHP 7.0.15
  • MySQLi 5.6.35
avatar wilsonge
wilsonge - comment - 26 Jul 2017

What happens if you turn off multilang out of interest? Seems unlikely but maybe that's affecting it??

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 26 Jul 2017

Disabled Plugins "Language Code" and "Language Filter" > same Result as above.

Set "Create Article"-Menu on Access-Level "Special", logout, click Article with alias "create-article" > Login-Menu and Message "Please login first".

avatar franz-wohlkoenig franz-wohlkoenig - test_item - 26 Jul 2017 - Tested successfully
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 26 Jul 2017

I have tested this item successfully on 10f591e

After PR applied "Notice: Undefined index: a_id in /libraries/cms/component/router/rules/standard.php on line 201" is gone.

@wilsonge new Install of staging solved Problem discussed above.


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

avatar franz-wohlkoenig franz-wohlkoenig - change - 26 Jul 2017
Status Pending Ready to Commit
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 26 Jul 2017

RTC after two successful tests.

avatar mbabker
mbabker - comment - 29 Jul 2017

@asika32764 can you resolve the merge conflict please?

avatar asika32764 asika32764 - change - 29 Jul 2017
Labels Added: Conflicting Files ?
avatar asika32764
asika32764 - comment - 29 Jul 2017

Done

avatar mbabker mbabker - change - 29 Jul 2017
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2017-07-29 16:12:07
Closed_By mbabker
Labels Removed: Conflicting Files
avatar mbabker mbabker - close - 29 Jul 2017
avatar mbabker mbabker - merge - 29 Jul 2017

Add a Comment

Login with GitHub to post a comment