OpenSEF bug in components url Print E-mail
Thursday, 03 January 2008 01:51

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.

Image

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.

Comments
Search
Only registered users can write comments!

!joomlacomment 4.0 Copyright (C) 2009 Compojoom.com . All rights reserved."

Last Updated on Friday, 03 July 2009 21:39