xoops forums

mboyden

Moderator
Posted on: 2008/12/14 22:08
mboyden
mboyden (Show more)
Moderator
Posts: 484
Since: 2005/3/9 1
#1

XOOPSinfo Conflict When Using ThAdmin and Other Modules

I was having problems in 2.3.x with a few modules (news, iStats, eXtgallery) in the admin menu with XoopsInfo installed and ThAdmin in operation (disabling ThAdmin, but left installed worked fine). After searching I found several postings related to the same problem (here, here, and here) in XOOPS 2.0.x and 2.3.x with similar symptoms.

The error I got when visiting any of the affected modules was
cannot redeclare adminmenu() (previously declared in ...) in .../xoopsinfo/include/functions.php

So, I fixed it with this hack. In the xoopsinfo/include/functions.php file, enclose/wrap the function adminmenu declare like this:
if (!function_exists('adminmenu')) {
     
// insert original function adminmenu() {} code here
}

This prevents the function from being declared here in XOOPSinfo when other modules are in operation. Hey, it works, and hopefully it will get fixed. Not sure if it's a problem with ThAdmin, but I expect more likely something in XOOPSinfo.
Pessimists see difficulty in opportunity; Optimists see opportunity in difficulty. --W Churchill

XOOPS: Latest | Debug | Hosting and Web Development

trabis

Core Developer
Posted on: 2008/12/14 22:43
trabis
trabis (Show more)
Core Developer
Posts: 2268
Since: 2006/9/1 1
#2

Re: XOOPSinfo Conflict When Using ThAdmin and Other Modules

All modules should prefix their functions that's why.
Guess the problem is in both modules.

mboyden

Moderator
Posted on: 2008/12/14 23:26
mboyden
mboyden (Show more)
Moderator
Posts: 484
Since: 2005/3/9 1
#3

Re: XOOPSinfo Conflict When Using ThAdmin and Other Modules

Quote:
trabis wrote:
All modules should prefix their functions that's why.
Guess the problem is in both modules.

Absolutely, agree on the function nomenclature. However, it's also interesting that the problem only exists when ThAdmin is installed (or XOOPSInfo). It works fine with just one or the other is installed, but not when both are. Anyhoos, FWIW....
Pessimists see difficulty in opportunity; Optimists see opportunity in difficulty. --W Churchill

XOOPS: Latest | Debug | Hosting and Web Development

Mamba

Moderator
Posted on: 2008/12/14 23:49
Mamba
Mamba (Show more)
Moderator
Posts: 10988
Since: 2004/4/23
#4

Re: XOOPSinfo Conflict When Using ThAdmin and Other Modules

Quote:
All modules should prefix their functions that's why.

Marco has developed a "Quality Checklist" for module developers. If it's not already there, it should be probably added.
Support XOOPS => DONATE
Use 2.5.10 | Docs | Modules | Bugs

zoullou

Quite a regular
Posted on: 2008/12/15 22:11
zoullou
zoullou (Show more)
Quite a regular
Posts: 250
Since: 2004/3/2 0
#5

Re: XOOPSinfo Conflict When Using ThAdmin and Other Modules

Hi,

Will be fixed in eXtGallery 1.0.5

Yours