sorry i should explain more.
$GLOBALS["xoopsModule"] is defined like this after including kernel/module.php file:
$module_handler =& xoops_gethandler( 'module' ) ;
$xoopsModule =& $module_handler->getByDirname( $mydirname ) ;
in other words $xoopsModule is a global object variable defined in kernel/module.php
So it is up to core developers how to name it.
they generally name it $xoopsModule but somehow they name it $module in XOOPSCORE255/search.php
see lines 134-168:
$module_handler =& xoops_gethandler('module');
$criteria = new CriteriaCompo(new Criteria('hassearch', 1));
$criteria->add(new Criteria('isactive', 1));
$criteria->add(new Criteria('mid', "(" . implode(',', $available_modules) . ")", 'IN'));
$modules = $module_handler->getObjects($criteria, true);
$mids = isset($_REQUEST['mids']) ? $_REQUEST['mids'] : array();
if (empty($mids) || ! is_array($mids)) {
unset($mids);
$mids = array_keys($modules);
}
$xoopsOption['xoops_pagetitle'] = _SR_SEARCHRESULTS . ': ' . implode(' ', $queries);
include $GLOBALS['xoops']->path('header.php');
$nomatch = true;
echo ""
. _SR_SEARCHRESULTS . "n";
echo _SR_KEYWORDS . ':';
if ($andor != 'exact') {
foreach ($queries as $q) {
echo ' ' . htmlspecialchars(stripslashes($q)) . '';
}
if (!empty($ignored_queries)) {
echo '
';
printf(_SR_IGNOREDWORDS, $xoopsConfigSearch['keyword_min']);
foreach ($ignored_queries as $q) {
echo ' ' . htmlspecialchars(stripslashes($q)) . '';
}
}
} else {
echo ' "' . htmlspecialchars(stripslashes($queries[0])) . '"';
}
echo '
';
foreach ($mids as $mid) {
$mid = intval($mid);
if (in_array($mid, $available_modules)) {
$module = $modules[$mid];
$results = $module->search($queries, $andor, 5, 0);
these lines are important:
$module_handler =& xoops_gethandler('module');
.....
$modules = $module_handler->getObjects($criteria, true);
.....
....
$module = $modules[$mid];
But in most modules module developers will use $GLOBALS["xoopsModule"]
I wonder why no module developer encounter this issue before.
It seems no developer needed $GLOBALS["xoopsModule"] in his search function.
but i need it in newbb.
i dont have issue inside module in modules/newbb/search.php
but i should correct it for XOOPSCORE/search.php
so i did these changes yesterday and now it is work fine:
http://sourceforge.net/p/xoops/svn/10246/