hwdevteam VIP
Total posts: 76
25 Feb 2014 22:31

Fatal error: Cannot redeclare class Url in /home/accountname/public_html/components/com_cobalt/library/php/helpers/url.php on line 17

MijoEvents loads a class called "Url", and so does Cobalt, except that the Cobalt class is still being loaded even when inside the MijoEvents component.

The simple fix is to change components/com_cobalt/library/php/helpers/url.php

$component_params = JComponentHelper::getParams('com_cobalt');

define('COBS', $component_params->get('separator', ':'));

To:

$component_params = JComponentHelper::getParams('com_cobalt');

define('COBS', $component_params->get('separator', ':'));

if (class_exists('Url')) return false; //HW:

Last Modified: 02 Mar 2014


Sergey
Total posts: 13,748
26 Feb 2014 00:07

Unfortunately we cannot rename this class. And this fix will avoid fatal error but will make Cobalt unworkable. because we need this class.


Sergey
Total posts: 13,748
27 Feb 2014 00:05

DO all components normally come with a URL class?

Every developer craete own name. That was probably my mistake to call this class Url since it is common name. I should call it something like CobUrl. But what is done is done.


Sergey
Total posts: 13,748
27 Feb 2014 23:13

See your editor for "Search and replace..." ;-)

I know. But problem is that is is often used in templates. And all who made custom templates by coping default templates also have it there. If I change it, this update will simply break all sites with custom templates with is not fun.

Powered by Cobalt