Skip to content

Comments

[Regression] If the link does not have a view then add active menu item#19501

Closed
csthomas wants to merge 1 commit intojoomla:stagingfrom
csthomas:repair_not_full_link
Closed

[Regression] If the link does not have a view then add active menu item#19501
csthomas wants to merge 1 commit intojoomla:stagingfrom
csthomas:repair_not_full_link

Conversation

@csthomas
Copy link
Contributor

Pull Request for Issues #19499 and #19496

Summary of Changes

Add active menu item to incomplete link, ex: JRoute::_('index.php?option=com_kunena');

This PR is a little similar to #19498 but prevents to add an active Itemid to full link like JRoute::_('index.php?option=com_content&view=archive'); when there is no menu item for the archive view.

The full link will still not depend on the page it was generated on.

Testing Instructions

See at issues #19499 and #19496.

Expected result

Issues are fixed.

@810
Copy link
Contributor

810 commented Jan 31, 2018

I have tested this item 🔴 unsuccessfully on 1329077

404 Component not found.

Kunena
settings: Direct Component Access = "No"


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

@810
Copy link
Contributor

810 commented Jan 31, 2018

ps Kunena 5.1 RC2 is working correctly, because we added now itemid: Kunena/Kunena-Forum@3161bb5

@csthomas
Copy link
Contributor Author

csthomas commented Jan 31, 2018

I do not know which link does not work for you, but there is some issue in kunena routing because I can not generate a correct link by JRoute::_('index.php?option=com_kunena&view=search'); which should be /forum/search when I generated it from other place that kunena, ex article view.

How to check?
Put <?= JRoute::_('index.php?option=com_kunena&view=search'); ?> below <body> in active template. When you go to article view then link is /component/kunena/search but when you go to forum then it is correct /forum/search.

I tested it on 3.8.3. On 3.8.4 with this PR the link is always /component/kunena/search.
For me this is now kunena issue.

@OctavianC
Copy link
Contributor

I have tested this item 🔴 unsuccessfully on 1329077

Running this code:

var_dump(JRoute::_('index.php?option=com_content'));
var_dump(JRoute::_('index.php?option=com_content&view=test'));
var_dump(JRoute::_('index.php?option=com_content&task=test'));
var_dump(JRoute::_('index.php?view=test'));
var_dump(JRoute::_('index.php?task=test'));
var_dump(JRoute::_('index.php?option=com_content&test=1'));

Produces:

string(24) "/j384/index.php/articles"
string(44) "/j384/index.php/component/content/?view=test"
string(44) "/j384/index.php/component/content/?task=test"
string(34) "/j384/index.php/articles?view=test"
string(34) "/j384/index.php/articles?task=test"
string(31) "/j384/index.php/articles?test=1"

In Joomla! 3.8.3:

string(24) "/j384/index.php/articles"
string(34) "/j384/index.php/articles?view=test"
string(34) "/j384/index.php/articles?task=test"
string(34) "/j384/index.php/articles?view=test"
string(34) "/j384/index.php/articles?task=test"
string(31) "/j384/index.php/articles?test=1"

So it's broken yet again; no offense but I'd refrain from making any more commits until your original one is reverted.


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

@csthomas csthomas closed this Jan 31, 2018
@csthomas csthomas deleted the repair_not_full_link branch February 1, 2018 09:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants