spacer.png, 0 kB
OpenSEF bug in components url Print E-mail
Written by molgyk   
Thursday, 03 January 2008

My blog is based on Joomla 1.0.13 and uses the OpenSEF component to generate search engines friendly urls. One great OpenSEF feature is its use of the menus to generate nice directory-like urls for the main components of one's website. For example, http://www.moleculargeek.net/index.php? option=com_docman&Itemid=42 may become (this may be customized) http://www.moleculargeek.net/downloads/ as the menu item pointing to the component is named downloads. This works out of the box except for a tiny bug for which I just found a workaround...

Symptoms

OpenSEF does not generate the component-specific urls for a specific component.

E.g. http://www.moleculargeek.net/index.php?option=com_docman&Itemid=42 is not rewritten to http://www.moleculargeek.net/downloads/

SEF urls for other components are not affected.

E.g. http://www.moleculargeek.net/index.php?option=com_contact&Itemid=3 is still rewritten to http://www.moleculargeek.net/contact/

Cause

As mentioned above, OpenSEF uses the menu items pointing toward the components to generate the SEF url. When menu items are deleted using the administration interface, they are not removed from the database. Instead their "published" property is set to -2.

Click to enlarge

The consequence is that duplicated items in the menu table of a joomla database might be found by OpenSEF which will only consider the first one regardless of its status. However the id of the considered menu item wil not match the id OpenSEF expects and the url will not be processed as expected.

Workaround

A simple workaround is to add directly a character (# for example) to the deleted menu entries (where "published" is set to -2) in the Joomla database at the end of the "link" field value.

Other prettier solutions could be found which would involve changing the OpenSEF query to the menu table so that it would ignore the deleted menu items.


Add to favourites (0) | Quote this article on your site | Views: 544

Add a first comment to this article

Only registered users can write comments. Please login or register

 

Last Updated ( Tuesday, 22 January 2008 )
spacer.png, 0 kB
spacer.png, 0 kB
   
Design based on the Natura template from www.joomlashack.com - CC share alike license