?
avatar Klipper
Klipper
27 Jan 2015

Steps to reproduce the issue

1.) Install or start with fresh Joomla 3.3.6 site using the Joomla example data for testing.
2.) In Global configuration disable both SEF and URL rewriting (just for creating readable printurl)
3.) Go to Template manager and make a copy (template style) of Protostar and name it something like Protostar - Red.
4.) Open this Protostar - Red templatestyle, open the Advanced tab and at 'Template Colour' change the colour to a red colour. Save the template style.
5. In Top menu create a new menu-item 'Test-blue', menu-item type is single article and point the menu-item to the article 'Joomla Testing'. For template style choose 'Use Default' (Protostar)
6.) In Top menu create a new menu-item 'Test-red', menu-item type is single article and point the menu-item to the same article 'Joomla Testing'. For template style choose 'Protostar - Red'.
7.) Reload front-end. New menu-items will be visible in top menu.
8.) Click the Test-blue menu-item. Joomla Testing page (Yes it's the homepage), choose the Print menu-item in the little dropdownmenu, and component.php will load, presenting only the component with the correct blue style.
9.) Now on the front-end click the 'Test-red' menu-item. Same page but in red colours. Choose again Print. You should expect the component in red colours, but no: they are blue!!!

Actual result

When you compare in both pages the Itemid in the print-url with the one of the current page, you will see that in both cases the Itemid's are NOT the same. In my setup the Test-red page has Itemid: 480, and Test-blue has Itemid: 481. But the item-id in the print-url is 435. This is the Itemid from de Home menu-item in 'Main menu'.

In this example I used the homepage article, but I discovered this bug on a website with 5 different template styles, using complete different content. What I found out is that the print-url in all cases gets the lowest Itemid of the menu-item pointing to this article. So the print-url is NOT based on the ItemID of the current page. As long you only use one default templatestyle, there is no problem, but with more menu-items using different templatestyles pointing to same article we get this wrong templatestyle for printing.

Expected result

Of course the print-url should use the same Item-Id as the current page, using the same template-style for printing.

System information (as much as possible)

Happens on different online hosts and also on localhost.

Votes

# of Users Experiencing Issue
2/2
Average Importance Score
3.00

avatar Klipper Klipper - open - 27 Jan 2015
avatar Klipper Klipper - change - 27 Jan 2015
The description was changed
avatar brianteeman brianteeman - change - 28 Jan 2015
Labels Added: ?
avatar Klipper
Klipper - comment - 10 Apr 2015

This issue is still present in Joomla 3.4.2.current staging


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

avatar HermanPeeren
HermanPeeren - comment - 10 Apr 2015

confirmed


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

avatar zero-24 zero-24 - change - 10 Apr 2015
Status New Confirmed
Build 3.3.6 3.4.1
avatar Klipper
Klipper - comment - 13 Apr 2015

Found out that this wrong Itemid problem not only exist in the print link, but also in the submitted link when using the 'Email this link to a friend.' form.


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

avatar Achal-Aggarwal
Achal-Aggarwal - comment - 17 Apr 2015

Here wrong/different itemid is not a problem. The component template of protostar theme doesn't have code to apply different template colour other than default. #justanobservation

avatar Klipper
Klipper - comment - 17 Apr 2015

This is not only a wrong colour issue with the protostar template. The problem is much deeper in the routeing logic of Joomla! Every different template with multiple templatestyles will get this problem. Also the 'sending a link to a friend' feature will send the wrong url, with wrong Itemid. And even languages and modules can get trouble with this, because they all depends on Item-ids


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

avatar brianteeman brianteeman - change - 10 Mar 2016
Category Front End Templates (site) Front End Router / SEF Templates (site)
avatar brianteeman
brianteeman - comment - 13 Apr 2016

The key to this issue is

What I found out is that the print-url in all cases gets the lowest Itemid of the menu-item pointing to this article.

Its another case of where we have an issue when there are multiple menu items pointing to the same content


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

avatar Kubik-Rubik
Kubik-Rubik - comment - 8 May 2016

Hi @Klipper! You created this issue sometime ago but have not provided any code for people to evaluate. As no one else has shown any interest in providing the code and you have not then I am closing this issue at this time. If code is provided (a pull request) it can always be re-examined.

avatar Kubik-Rubik Kubik-Rubik - change - 8 May 2016
Status Confirmed Closed
Closed_Date 0000-00-00 00:00:00 2016-05-08 16:20:10
Closed_By Kubik-Rubik
avatar Kubik-Rubik Kubik-Rubik - close - 8 May 2016

Add a Comment

Login with GitHub to post a comment