Fork me on GitHub
Get XOOPS XOOPSXOOPS FAQFAQ ForumsForums NewsNews ThemesThemes ModulesModules
New Posts New Topics All Posts All Forums Index General Modules Themes Development International XOOPS.org

Search

Donat-O-Meter

Make donations with PayPal!
Stats
Goal: $100.00
Due Date: Sep 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00

Learn XOOPS Core

Local Support

Advertisement

XOOPS Code hosted on SourceForge

Cumulus Tag Cloud

- 2 2.5 2.6 3.0 4 6 2013 adslight Android AntiHarvesting AntiMalUser AntiSpam API Apple Battlefield billige Bootstrap Captcha cell chronolabs CHUNG Clicks content CĂN demo docek download Dresses evden eve facebook Fat floor Food for free Gateway Google Guide herre Home Honeypot HP Human HỘ IP iPhone jQuery Language List log Loss mobile module modules Monster new newbb news NHÀ online PARK phone PHP Prevention profile project Protector publisher Rapid RESIDENCE responsive review Rights rmcommon security Sentry site Smartphone Smoking Solution Spam stem Studio tags tdmcreate template The Theme themes web weight Wishcraft xoops Xortify XPayment ZendFramework

New Users

Registering user

# 137774

georgi

Welcome to XOOPS!




Bottom   Previous Topic   Next Topic  Register To Post



#1 Posted on: 1/13 14:15 Bug in xoops_getModuleOption()
I found an error in the function xoops_getModuleOption().
The module MYMODULE1 configuration is IMGDIR.
The module MYMODULE2 configuration is IMGDIR.
The names of the modules are the same configurations.
If both call functions
$conf1 = xoops_getModuleOption( 'IMGDIR', 'MYMODULE1' );
$conf2 = xoops_getModuleOption( 'IMGDIR', 'MYMODULE2' );
then the last call will return the configuration of the first module
I corrected this error. The code below:
function xoops_getModuleOption($option$dirname '')
{
    static 
$modOptions = array();
    if (
is_array($modOptions) && isset($modOptions[$dirname][$option])) {
        return 
$modOptions[$dirname][$option];
    }

    
$ret false;
    
$module_handler =& xoops_gethandler('module');
    
$module =& $module_handler->getByDirname($dirname);
    
$config_handler =& xoops_gethandler('config');
    if (
is_object($module)) {
        
$moduleConfig =& $config_handler->getConfigsByCat(0$module->getVar('mid'));
        if (isset(
$moduleConfig[$option])) {
            
$ret $moduleConfig[$option];
        }
    }
    
$modOptions[$dirname][$option] = $ret;
    return 
$ret;
}


Top

andrey3761
XOOPS Translator
XOOPS Translator
Joined:
2008/8/21 11:28
From Transnistrian
Group:
Registered Users
Posts: 223
(Show More) (Show Less)


#2 Posted on: 1/13 15:12 Re: Bug in xoops_getModuleOption()
Thanks, Andrey. That's great!
Could you please submit it to SourceForge Bug Tracker, with the link to this thread?
Thanks!

Top


Please support XOOPS & DONATE
Use 2.5.7 | Debugging | Requests | Bugs
Mamba
Moderator
Moderator
Joined:
2004/4/23 13:58
From Ohio, USA
Group:
Webmaster
Registered Users
Designer Group
Posts: 8055
(Show More) (Show Less)


#3 Posted on: 1/14 12:23 Re: Bug in xoops_getModuleOption()
Hi Mamba!
I submit an bug report.
https://sourceforge.net/p/xoops/bugs/1291/

Top

andrey3761
XOOPS Translator
XOOPS Translator
Joined:
2008/8/21 11:28
From Transnistrian
Group:
Registered Users
Posts: 223
(Show More) (Show Less)







You can view topic.
You cannot start a new topic.
You cannot reply to posts.
You cannot edit your posts.
You cannot delete your posts.
You cannot add new polls.
You cannot vote in polls.
You cannot attach files to posts.
You cannot post without approval.
You cannot use topic type.
You cannot use HTML syntax.
You cannot use signature.

[Advanced Search]