Page 1 of 1

Cannot redeclare categorytree

Posted: 18 Nov 2011, 00:12
by reetp
On Joomla 1.7.x with gantry I just tried to add a Gallery Tree module in a sidebox Module position.

As soon as it is enable, I get the following errors and a blank page :

Debug Strict (PHP 5): /solstice/modules/mod_phocagallery_tree/mod_phocagallery_tree.php line 134 - Non-static method JSite::getMenu() should not be called statically
Debug Strict (PHP 5): /solstice/modules/mod_phocagallery_tree/mod_phocagallery_tree.php line 134 - Only variables should be assigned by reference
Compile Error: /solstice/modules/mod_phocadownload_tree/mod_phocadownload_tree.php line 124 - Cannot redeclare categorytree() (previously declared in /my_path/modules/mod_phocagallery_tree/mod_phocagallery_tree.php:121)

I have downloaded and installed version 3.1.1 but strangely when I checked for updates I notice that the version for 1.6/1.7 is 3.1.0 ??

https://www.phoca.cz/version/index.php?p ... lery=3.1.1

Any suggestions gratefully appreciated

B. Rgds
John

Re: Cannot redeclare categorytree

Posted: 18 Nov 2011, 00:17
by Jan
Hi, you should disable displaying of strict warnings in php settings (search this forum to get information why it is not possible to make all features of Joomla! or Phoca Code to fit strict warnings)

Jan

Re: Cannot redeclare categorytree

Posted: 18 Nov 2011, 13:30
by reetp
Hi Jan,

thanks for the reply.

The odd thing is that php.ini is set as follows :

error_reporting = E_WARNING & ~E_NOTICE
display_errors = On

So strict is disabled as far as I can see.....

Any thoughts ?

B. Rgds
John

Re: Cannot redeclare categorytree

Posted: 18 Nov 2011, 13:46
by reetp
Sorry - I think I misled you about the module - it should mod_phocagallery_tree_v3.0.1.zip

It should display a tree of the categories in a block.

Have tried setting display_errors = off but that makes no difference.

I'd be grateful for any other suggestions !

B. Rgds
John

PS - Phoca Download tree works fine.......

Re: Cannot redeclare categorytree

Posted: 07 Dec 2011, 01:00
by reetp
Just tried disabling Downloads and enabling Gallery and it then works fine.

it would seem that you cannot run them both in a side box at the same time.

This is the giveaway when I thought about it.
Compile Error: /solstice/modules/mod_phocadownload_tree/mod_phocadownload_tree.php line 124 - Cannot redeclare categorytree() (previously declared in /my_path/modules/mod_phocagallery_tree/mod_phocagallery_tree.php:121)


This function is duplicated :

Code: Select all

// Create category tree
function categoryTree( $data, $tree, $id=0, $text='', $treeId ) {      
   foreach ( $data as $value ) {   
      if ($value->parentid == $id) {
         $link = JRoute::_(PhocaGalleryRoute::getCategoryRoute($value->id, $value->alias));
         $showText =  $text . ''.$treeId.'.add('.$value->id.','.$value->parentid.',\''.addslashes($value->text).'\',\''.$link.'\');'."\n";
         $tree[$value->id] = $showText;
         $tree = categoryTree($data, $tree, $value->id, '', $treeId);   
      }
   }
   return($tree);
}
Not sure what the answer is, but this is the problem.

B. Rgds
John

Re: Cannot redeclare categorytree

Posted: 08 Dec 2011, 18:20
by Jan
Hi, I will take a look at it.

Jan

Re: Cannot redeclare categorytree

Posted: 31 Dec 2011, 15:46
by Jan

Re: Cannot redeclare categorytree

Posted: 16 Feb 2013, 01:51
by francesco.r
Hi, I'm having a similar error using the vm category module. (version 1.0.0)
If I publish two instances I get the following error and the page stops processing

Code: Select all

Fatal error: Cannot redeclare PhocaVmCategoryTree() (previously declared in /web/htdocs/www.[website].com/home/modules/mod_phoca_vm_category/mod_phoca_vm_category.php:34) in /web/htdocs/www.[website].com/home/modules/mod_phoca_vm_category/mod_phoca_vm_category.php on line 155
Any help? Thank you

Re: Cannot redeclare categorytree

Posted: 18 Feb 2013, 22:18
by Jan
Hi, this is only one instance module.

Jan