Possible com_content router.php issue in Joomla 1.5.22 ?

This forum is for reporting bugs in Joomla!. Please don't report problems with extensions in here.
Locked
User avatar
DeanMarshall
Joomla! Hero
Joomla! Hero
Posts: 2352
Joined: Fri Aug 19, 2005 2:26 am
Location: Lancaster, Lancashire, United Kingdom
Contact:

Possible com_content router.php issue in Joomla 1.5.22 ?

Post by DeanMarshall » Thu Jan 13, 2011 12:55 pm

I've got a client site with a custom html module into which the client has linked a few images to specific internal pages within the website.

Non-sef url:
http://www.example.org/index.php?option ... &Itemid=94
within the module's html the & are correct html entities &

SEF Url: results in 500 error missing view (I think 66 is being interpreted as a view)
http://www.example.org/component/content/66

Question: where did the Itemid go?
Question: didn't com_content sef links used to look better than this?

A possible SEF Urls that would work:
http://www.example.org/component/content/article/66

Within router.php I see the following block of code:

Code: Select all

if(isset($query['view']))
	{
		$view = $query['view'];
		if(empty($query['Itemid'])) {
			$segments[] = $query['view'];
		}
		unset($query['view']);
	};
If I am reading that correctly 'view' gets discarded except where there is no Itemid.
Question: is that correct behaviour?

To me it just seems broken - and indeed on the client's site it is very broken.
Can anyone shed any light on the above.

Dean
Dean Marshall Consultancy - six Joomla experts - http://www.deanmarshall.co.uk/

Joomla Experts - Joomla Support http://www.deanmarshall.co.uk/joomla-se ... pport.html

User avatar
DeanMarshall
Joomla! Hero
Joomla! Hero
Posts: 2352
Joined: Fri Aug 19, 2005 2:26 am
Location: Lancaster, Lancashire, United Kingdom
Contact:

Re: Possible com_content router.php issue in Joomla 1.5.22 ?

Post by DeanMarshall » Thu Jan 13, 2011 2:20 pm

Okay - some further digging has turned up the following information:
1) If the link contains an Itemid then the sef link will be to that exact menu item - regardless of the rest of the url. Soooo if the url was taken from within the content area of a page and had the Itemid of the current page - the sef link would not go to the intended page at all.

So, if the client has collected (non-sef links) from modules such as popular or latest news they will have links that once converted to sef will point to the wrong page.

2) Worse still - and this is what happened to some of my client's links - following a site re-organisation some menu items get unpublished. Any links that carry the Itemid of the unpublished menu item (even though not intended to resolve to that page) will break entirely with the server 500 error. Because their is an Itemid present in the url - the router.php file drops the 'view' parameter. Instead the article id is the next variable - Joomla interprets the article id as being a view - which doesn't exist and dies.


I don't really know how this hasn't been spotted before now - we've just gone back and looked at another client's site and the first site we've looked at is broken in the same way.

How can we tell inexperienced users to remove inappropriate Itemids from urls they copy?

If without sef - a link shows the correct article - but the Itemid controls the module/template display, why is the behaviour different when SEF is turned on?

Hoping someone with more knowledge on this specific subject can chime in with some tips on how to prevent these issues.

Dean
Dean Marshall Consultancy - six Joomla experts - http://www.deanmarshall.co.uk/

Joomla Experts - Joomla Support http://www.deanmarshall.co.uk/joomla-se ... pport.html

User avatar
DeanMarshall
Joomla! Hero
Joomla! Hero
Posts: 2352
Joined: Fri Aug 19, 2005 2:26 am
Location: Lancaster, Lancashire, United Kingdom
Contact:

Re: Possible com_content router.php issue in Joomla 1.5.22 ?

Post by DeanMarshall » Thu Jan 13, 2011 2:22 pm

Oh - and for anyone wanting/needing a temporary workaround for the server 500 error - view missing - we crafted the following rule which when added to .htaccess file prevents the error and at least ensures the user sees the page in question.

Code: Select all

RewriteRule ^component\/content\/(\d*)$ /component/content/article/$1 [R=301,L]


Dean
Dean Marshall Consultancy - six Joomla experts - http://www.deanmarshall.co.uk/

Joomla Experts - Joomla Support http://www.deanmarshall.co.uk/joomla-se ... pport.html


Locked

Return to “Joomla! 1.5 Bug Reporting”