User tests: Successful: Unsuccessful:
Modify JComponentRouterRulesStandard
add $query['id']
into isset() so this build rule will not error if id not exists.
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.
JRoute should return a wrong URL not error message.
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.
Status | New | ⇒ | Pending |
Category | ⇒ | Libraries |
I have tested this item
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.
No create a child article with the same alias as the "submit article" menu item
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.
@asika32764 thanks for Info. So its an issue to test for Devs.
@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
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
Patch this dude https://github.com/joomla/joomla-cms/blob/staging/libraries/src/Joomla/CMS/Component/Router/Rules/StandardRules.php Same file new location
Patch applied, same Result: Click on Article (Alias "test") in Blog-View open "Create Article"-Menu (Alias "test").
What happens if you turn off multilang out of interest? Seems unlikely but maybe that's affecting it??
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".
I have tested this item
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.
Status | Pending | ⇒ | Ready to Commit |
RTC after two successful tests.
@asika32764 can you resolve the merge conflict please?
Labels |
Added:
Conflicting Files
?
|
Done
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
|
@Hackwar