":" colon is causing problem to JRoute of Joomla 1.7.3

Phoca Download - download manager
lazos99
Phoca Newbie
Phoca Newbie
Posts: 1
Joined: 05 Jan 2012, 19:10

":" colon is causing problem to JRoute of Joomla 1.7.3

Post by lazos99 »

Hi and thanks very much for this great component.
I installed the latest phocadownload to the latest Joomla (1.7.3) and it seems there is a problem when phocadownload is requesting the URL of a category with the alias in the URL e.g (/index.php?option=com_phocadownload&view=category&id=6:2012&Itemid=159).

When the JRoute is processing the URL it seems that ":" colon is causing problems here:
Joomla libraries string.php line 752 parse_url($encodedURL);
The parse_url things that the colon it was set us a port in the url and this is causing problem to the JRoute process because the return URL looks like this (?option=com_phocadownload&view=category&id=6:2012&Itemid=159) the index.php is missing. The same thing when I am using SEF URLS too.

Maybe you need to change that colon with something else or maybe I am wrong. You are the programer you know better than me. :)

Thanks.
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 49144
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: ":" colon is causing problem to JRoute of Joomla 1.7.3

Post by Jan »

Hi, the colon is standard Joomla! string for IDs separating (ID:alias)

see e.g. content router code (Joomla! code):

Code: Select all

if ($view == 'article') {
			if (isset($query['id']) && isset($query['catid']) && $query['catid']) {
				$catid = $query['catid'];
				// Make sure we have the id and the alias
				if (strpos($query['id'], ':') === false) {
					$db = JFactory::getDbo();
					$aquery = $db->setQuery($db->getQuery(true)
						->select('alias')
						->from('#__content')
						->where('id='.(int)$query['id'])
					);
					$alias = $db->loadResult();
					$query['id'] = $query['id'].':'.$alias;
				}
			} else {
				// we should have these two set for this view.  If we don't, it is an error
				return $segments;
			}
		}
If you find Phoca extensions useful, please support the project
Post Reply