1
blackrx
White Screen when accessing modules as admin
  • 2017/11/17 10:21

  • blackrx

  • Quite a regular

  • Posts: 227

  • Since: 2008/2/5 1


i've been using XOOPS 2.5.9 for few months and just this few days having this problem ..

im having white screen problem when accessing few modules when im logged in
extcal, extgallery,tdmdownload, xoopspoll etc all are latest modules from github

publisher and all my clone publisher are working fine

the blocks of the modules are displaying, i can access the module admin and keyin data but i just can't access the module index page or sub pages when i'm logged in

but when i logged out, i can access the modules pages without problem
there are only 4 user in the site all admin..all having the same problem

What i did so far to try debug the problem


a. turn on debug..no error
b. i asked my host..no server changes
c. i tried deactive all modules except the affected modules
d. empty session table
e. clear cache
f. no server error log
f. update all the modules in admin
g. check group permission - i can update all the modules key in new data

but still im having white screen when im logged in

XOOPS Version XOOPS 2.5.9
PHP Version 5.6.32
mySQL Version 5.6.38

any other else suggestion what to check ?

2
Mamba
Re: White Screen when accessing modules as admin
  • 2017/11/17 11:34

  • Mamba

  • Moderator

  • Posts: 11381

  • Since: 2004/4/23


In Chrome right click and open the "Inspect" window and then refresh the screen. Sometimes the Inspect can show you what files (e.g. Javascript) are missing, or conflicting.

Also, you might try with a different theme and see if this helps....

Worse case scenario: if you can reproduce it constantly, then deactivate one module at a time, and see if the issues went away. If they did, then you know which one module might be the problem....
Support XOOPS => DONATE
Use 2.5.10 | Docs | Modules | Bugs

3
aerograf
Re: White Screen when accessing modules as admin
  • 2017/11/17 11:35

  • aerograf

  • Quite a regular

  • Posts: 214

  • Since: 2017/1/7 1


And what theme do you use in the admin panel? Try to change.

4
zyspec
Re: White Screen when accessing modules as admin
  • 2017/11/21 1:46

  • zyspec

  • Module Developer

  • Posts: 1095

  • Since: 2004/9/21


You might also want to check the Protector module logs to see if anything shows up there...

5
blackrx
Re: White Screen when accessing modules as admin
  • 2017/12/4 1:37

  • blackrx

  • Quite a regular

  • Posts: 227

  • Since: 2008/2/5 1


im using a custom xbootstrap theme

i finally figure out this problem it was the breadcrumb im using in my theme. i check the files inside the problem module and there is error log file..when i opened it i have this error

PHP Fatal error:  Call to a member function getVar() on boolean in /home/xxxxx/public_html/themes/xbootstrap/xoscripts/breadcrumb.php on line 79



line 79
foreach( $groups as $group ) {
        
$groups4assign[] = array( 'id' => $group->getVar('groupid') , 'name' => $group->getVar('name') ) ;
    }


.all this while it working fine..any quick fix ?

breadcrumb.php from https://xoops.org/modules/newbb/viewtopic.php?topic_id=71516

if( ! defined'XOOPS_ROOT_PATH' ) ) exit ;

//
// definitions
//

$theme_name basenamedirname(__FILE__) ) ;
$site_salt substrmd5XOOPS_URL ) , -) ;
$menu_cache_file XOOPS_TRUST_PATH.'/cache/theme_'.$theme_name.'_menus_'.$site_salt.'.php' ;

// root controllers
@include_once XOOPS_ROOT_PATH.'/language/'.$GLOBALS['xoopsConfig']['language'].'/user.php' ;
$root_controllers = array(
    
'/register.php' => array( 'name' => @_US_USERREG ) ,
    
'/userinfo.php' => array( 'name' => @_US_PROFILE ) ,
    
'/edituser.php' => array( 'name' => @_US_EDITPROFILE ) ,
    
'/viewpmsg.php' => array( 'name' => @_US_INBOX ) ,
    
'/readpmsg.php' => array( 'name' => @_US_INBOX 'url' => XOOPS_URL.'/viewpmsg.php' ) ,
    
'/notifications.php' => array( 'name' => @_NOT_NOTIFICATION ) ,
    
'/search.php' => array( 'name' => @_SR_SEARCH ) ,
) ;

// the best method is to be assigned by module self.  especially D3 modules have to assign this :-)

// the second best method to get breadcrumbs (rebuilding from an assigned var) NOT IMPLEMENTED
$modcat_assigns = array(
    
// 0=>var_name, 1=>separator
    
'mydownloads' => array( 'category_path' ' : ' ) ,
    
'mylinks' => array( 'category_path' ' : ' ) ,
) ;

// the last(worst) method to get breadcrumbs (querying parents recursively)
$modcat_trees = array(
    
// 0=>table, 1=>col4id, 2=>col4pid, 3=>col4name, 4=>GET index, 5=>_tpl_vars, 6=>url_fmt
    
'AMS'=>array('ams_topics','topic_id','topic_pid','topic_title','storytopic',null,'index.php?storytopic=%d'),
    
'articles'=>array('articles_cat','id','cat_parent_id','cat_name','cat_id',null,'index.php?cat_id=%d'),
    
'booklists'=>array('mybooks_cat','cid','pid','title','cid',null,'viewcat.php?cid=%d'),
    
'catads'=>array('catads_cat','cat_id','pid','title','cat_id',null,'adslist.php?cat_id=%d'),
    
'debaser'=>array('debaser_genre','genreid','subgenreid','genretitle','genreid',null,'genre.php?genreid=%d'),
    
'myAds'=>array('ann_categories','cid','pid','title','cid',null,'index.php?pa=view&cid=%d'),
    
'myalbum'=>array('myalbum_cat','cid','pid','title','cid','photo.cid','viewcat.php?cid=%d'),
    
'mydownloads'=>array('mydownloads_cat','cid','pid','title','cid',null,'viewcat.php?cid=%d'),
    
'mylinks'=>array('mylinks_cat','cid','pid','title','cid',null,'viewcat.php?cid=%d'),
    
'mymovie'=>array('mymovie_cat','cid','pid','title','cid',null,'viewcat.php?cid=%d'),
    
'news'=>array('topics','topic_id','topic_pid','topic_title','storytopic',null,'index.php?storytopic=%d'),
    
'piCal'=>array('pical_cat','cid','pid','cat_title','cid',null,'index.php?cid=%d'),
    
'plzXoo'=>array('plzxoo_category','cid','pid','name','cid','category.cid','index.php?cid=%d'),
    
'smartfaq'=>array('smartfaq_categories','categoryid','parentid','name','categoryid',null,'category.php?categoryid=%d'),
    
'smartsection'=>array('smartsection_categories','categoryid','parentid','name','categoryid',null,'category.php?categoryid=%d'),
    
'tutorials'=>array('tutorials_categorys','cid','scid','cname','cid',null,'listutorials?cid=%d'),
    
'weblinks'=>array('weblinks_category','cid','pid','title','cid',null,'viewcat.php?cid=%d'),
    
'weblog'=>array('weblog_category','cat_id','cat_pid','cat_title','cat_id',null,'index.php?cat_id=%d'),
    
'wfdownloads'=>array('wfdownloads_cat','cid','pid','title','cid',null,'viewcat.php?cid=%d'),
    
'wflinks'=>array('wflinks_cat','cid','pid','title','cid',null,'viewcat.php?cid=%d'),
    
'wfsection'=>array('wfs_category','id','pid','title','category',null,'viewarticles.php?category=%d'),
    
'wordpress'=>array('wp_categories','cat_ID','category_parent','cat_name','cat',null,'index.php?cat=%d'),
    
'xcgal'=>array('xcgal_categories','cid','parent','name','cat',null,'index.php?cat=%d'),
    
'xfsection'=>array('xfs_category','id','pid','title','category',null,'index.php?category=%d'),
) ;

global 
$xoopsUser$xoopsModule$xoopsOption$xoopsConfig;

$dirname is_object( @$xoopsModule ) ? $xoopsModule->getVar('dirname') : '' ;
$modname is_object( @$xoopsModule ) ? $xoopsModule->getVar('name') : '' ;

// for compatibility of 2.0.x from xoops.org
$this->assign( array(
    
'xoops_modulename' => $modname ,
    
'xoops_dirname' => $dirname ,
) ) ;

// groups
if( is_object( @$xoopsUser ) ) {
    
$member_handler =xoops_gethandler'member' ) ;
    
$groups $member_handler->getGroupsByUser$xoopsUser->getVar('uid') , true ) ;
    foreach( 
$groups as $group ) {
        
$groups4assign[] = array( 'id' => $group->getVar('groupid') , 'name' => $group->getVar('name') ) ;
    }
} else {
    
$groups4assign[] = array( 'id' => XOOPS_GROUP_ANONYMOUS 'name' => _GUESTS ) ;
}
$this->assign"xugj_groups" $groups4assign ) ;

// for speed up hack :-)
if( ! empty( $_SESSION['redirect_message'] ) ) {
    if( empty( 
$this->_tpl_vars['xoops_lblocks'] ) ) $this->_tpl_vars['xoops_lblocks'] = array() ;
    
array_unshift$this->_tpl_vars['xoops_lblocks'] , array( 'title' => 'Message' 'content' => $_SESSION['redirect_message'] , 'weight' => ) ) ;
    
$this->_tpl_vars['xoops_showlblock'] = ;
    
$is_redirected true ;
    unset( 
$_SESSION['redirect_message'] ) ;
}

// xoops_breadcrumbs
if( ! is_array( @$this->_tpl_vars['xoops_breadcrumbs'] ) ) {
    
$breadcrumbs = array() ;
    
// root controllers
    
if( ! is_object( @$xoopsModule ) ) {
        
$page strrchr$_SERVER['SCRIPT_NAME'] , '/' ) ;
        if( isset( 
$root_controllers$page ] ) ) {
            
$breadcrumbs[] = $root_controllers$page ] ;
        }
    } else {
        
// default
        
$breadcrumbs[] = array( 'url' => XOOPS_URL."/modules/$dirname/" 'name' => $modname ) ;
        if( isset( 
$modcat_assigns$dirname ] ) && strlen$tplvar xugj_assign_get_tpl_vars$this $modcat_assigns$dirname ][0] ) ) ) {
            
// get from breadcrumbs for each modules (the second best)
            
$tplvars_info $modcat_assigns$dirname ] ;
            
$bc_tmps explode$tplvars_info[1] , $tplvar ) ;
            
array_shift$bc_tmps ) ;
            foreach( 
$bc_tmps as $bc_tmp ) {
                if( 
preg_match'#href=(["']?)(.*)\1>(.*)a>#' , $bc_tmp , $regs ) ) {
                    
$breadcrumbs[] = array(
                        
'name' => $regs[3] ,
                        
'url' => $regs[2] ,
                    ) ;
                }
            }
            if( 
$tplvars_info[2] ) xugj_assign_clear_tpl_vars$this $tplvars_info[0] ) ;
        } else if( isset( 
$modcat_trees$dirname ] ) ) {
            
// category tree (the last method)
            
$tree_info $modcat_trees$dirname ] ;
            if( @
$_GET$tree_info[4] ] > $id_val intval$_GET$tree_info[4] ] ) ;
            else if( ! empty( 
$tree_info[5] ) ) $id_val xugj_assign_get_tpl_vars$this $tree_info[5] ) ;
            if( ! empty( 
$id_val ) ) $breadcrumbs array_merge$breadcrumbs xugj_assign_get_breadcrumbs_by_tree$tree_info[0] , $tree_info[1] , $tree_info[2] , $tree_info[3] , $id_val XOOPS_URL.'/modules/'.$dirname.'/'.$tree_info[6] ) ) ;
        }
        if( ! 
in_array( @$this->_tpl_vars['xoops_pagetitle'] , array( $modname $breadcrumbs[sizeof($breadcrumbs)-1]['name'] ) ) ) {
            
$breadcrumbs[] = array( 'name' => $this->_tpl_vars['xoops_pagetitle'] ) ;
        }
    }
    
$this->assign"xoops_breadcrumbs" $breadcrumbs ) ;
}

function 
xugj_assign_get_breadcrumbs_by_tree$table $id_col $pid_col $name_col $id_val $url_fmt $paths = array() )
{
    
$db =& Database::getInstance() ;

    
$sql "SELECT `$pid_col`,`$name_col` FROM ".$db->prefix($table)." WHERE `$id_col`=".intval($id_val) ;
    
$result $db->query$sql ) ;
    if( 
$db->getRowsNum$result ) == ) return $paths ;
    list( 
$pid $name ) = $db->fetchRow$result ) ;
    
$paths array_merge( array( array(
        
'name' => htmlspecialchars$name ENT_QUOTES ) ,
        
'url' => sprintf$url_fmt $id_val ) ,
    ) ) , 
$paths ) ;

    return 
xugj_assign_get_breadcrumbs_by_tree$table $id_col $pid_col $name_col $pid $url_fmt $paths ) ;
}


function 
xugj_assign_get_tpl_vars( &$smarty $dot_expression )
{
    
$indexes explode'.' $dot_expression ) ;
    
$current_array $smarty->_tpl_vars ;
    foreach( 
$indexes as $index ) {
        
$current_array = @$current_array$index ] ;
    }

    return 
$current_array ;
}


$menus = array() ;
@include 
$menu_cache_file ;
if( empty( 
$menus ) ) {
    
// cache menus
    
$module_handler =& xoops_gethandler'module' ) ;
    
$criteria = new CriteriaCompo( new Criteria'hasmain' ) ) ;
    
$criteria->add( new Criteria'isactive' ) ) ;
    
$criteria->add( new Criteria'weight' '>' ) ) ;
    
$modules =& $module_handler->getObjects$criteria true ) ;
    
$moduleperm_handler =& xoops_gethandler'groupperm' ) ;
    
$group_handler =& xoops_gethandler'group' ) ;
    
$groups =& $group_handler->getObjects() ;
    
$config_handler =& xoops_gethandler'config' ) ;

    
// backup
    
if( is_object( @$GLOBALS['xoopsModule'] ) ) {
        
$xoopsModuleBackup =& $GLOBALS['xoopsModule'] ;
        
$xoopsModuleConfigBackup =& $GLOBALS['xoopsModuleConfig'] ;
    }

    foreach( 
$groups as $group ) {
        
$groupid $group->getVar('groupid') ;
        
$read_allowed $moduleperm_handler->getItemIds'module_read' $groupid ) ;
        foreach( 
$modules as $module ) {
            if( 
in_array$module->getVar('mid') , $read_allowed ) ) {
                
$GLOBALS['xoopsModule'] =& $module ;
                
$module->loadInfo$module->getVar('dirname') ) ;
                if( ! 
$module->getInfo('sub') ) continue ; // テスト用テンポラリ(最後は消すこと)
                
$menus[$groupid][ $module->getVar('dirname') ] = array(
                    
'name' => $module->getVar('name') ,
                    
'dirname' => $module->getVar('dirname') ,
                    
'url' => '' ,
                    
'sub' => $module->getInfo('sub') ,
                ) ;
            }
        }
    }

    
// restore
    
if( is_object( @$xoopsModuleBackup ) ) {
        
$GLOBALS['xoopsModule'] =& $xoopsModuleBackup ;
        
$GLOBALS['xoopsModuleConfig'] =& $xoopsModuleBackup ;
    }

    
ob_start() ;
    
var_export$menus ) ;
    
$menus4cache ob_get_contents() ;
    
ob_end_clean() ;

    
$fp fopen$menu_cache_file 'wb' ) ;
    if( empty( 
$fp ) ) return ;
    
fwrite$fp "$menus = ".$menus4cache.";n?>" ) ;
    
fclose$fp ) ;
}


$united_menus = array() ;
foreach( 
$groups4assign as $group_tmp ) {
    if( 
is_array( @$menus$group_tmp['id'] ] ) ) $united_menus += $menus$group_tmp['id'] ] ;
}

$this->assign'xugj_menu_uls' xugj_assign_display_menu_ul_recursively$united_menus ) ) ;

function 
xugj_assign_display_menu_ul_recursively$level_menus $dirname '' ) {

    
$ret "
    n" ;
        foreach( 
    $level_menus as $menu ) {
            if( ! empty( 
    $menu['dirname'] ) ) $dirname $menu['dirname'] ;
            
    $ret .= "
  • n$dirname.'/'.$menu['url']."">".$menu['name']."n" ;
            if( ! empty( 
    $menu['sub'] ) && is_array$menu['sub'] ) ) $ret .= xugj_assign_display_menu_ul_recursively$menu['sub'] , $dirname ) ;
            
    $ret .= "
  • n" 
    ;
        }
        return 
    $ret "
n" 
;
}

?>

6
zyspec
Re: White Screen when accessing modules as admin
  • 2017/12/4 18:03

  • zyspec

  • Module Developer

  • Posts: 1095

  • Since: 2004/9/21


@blackrx

You might try and replace:
// groups 
if( is_object( @$xoopsUser ) ) { 
    
$member_handler =xoops_gethandler'member' ) ; 
    
$groups $member_handler->getGroupsByUser$xoopsUser->getVar('uid') , true ) ; 
    foreach( 
$groups as $group ) { 
        
$groups4assign[] = array( 'id' => $group->getVar('groupid') , 'name' => $group->getVar('name') ) ; 
    } 
} else { 
    
$groups4assign[] = array( 'id' => XOOPS_GROUP_ANONYMOUS 'name' => _GUESTS ) ;

$this->assign"xugj_groups" $groups4assign ) ;

with:
// groups 
$groups4assign = array();
if (
$GLOBALS['xoopsUser'] instanceof XoopsUser)) {
    
$member_handler xoops_gethandler('member'); 
    
$groups $member_handler->getGroupsByUser($GLOBALS['xoopsUser']->getVar('uid') , true);
    if (
is_array($groups)) {
        foreach( 
$groups as $group ) {
            
$groups4assign[] = array('id' => $group->getVar('groupid') , 'name' => $group->getVar('name')); 
        } 
    }
}
if (empty(
$groups4assign) { 
    
$groups4assign[] = array('id' => XOOPS_GROUP_ANONYMOUS 'name' => _GUESTS);

$this->assign'xugj_groups' $groups4assign ) ;


This code change initializes a couple of variables that may not be initialized properly. Let us know if this helps.

7
blackrx
Re: White Screen when accessing modules as admin
  • 2017/12/5 0:11

  • blackrx

  • Quite a regular

  • Posts: 227

  • Since: 2008/2/5 1


thank you zyspec i still received the white page as admin

8
zyspec
Re: White Screen when accessing modules as admin
  • 2017/12/5 0:42

  • zyspec

  • Module Developer

  • Posts: 1095

  • Since: 2004/9/21


Are you still getting the same error in themes/xbootstrap/xoscripts/breadcrumb.php?

9
blackrx
Re: White Screen when accessing modules as admin
  • 2017/12/15 14:46

  • blackrx

  • Quite a regular

  • Posts: 227

  • Since: 2008/2/5 1


Quote:

zyspec wrote:
Are you still getting the same error in themes/xbootstrap/xoscripts/breadcrumb.php?


Yes i still getting same error.. i decided to remove the breadcrumb script for the moment

Login

Who's Online

189 user(s) are online (75 user(s) are browsing Support Forums)


Members: 0


Guests: 189


more...

Donat-O-Meter

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

Latest GitHub Commits