1
MentalMuscle
Call To A Member Function On A Non-object...

I am getting the following error when clicking on the "System Admin" button in the root admin.php page:

Fatal error: Call to a member function on a non-object in C:\Inetpub\wwwroot\Shen\kernel\user.phpon line 212

Here is the code in reference:

function isAdmin( $module_id = null ) {
if ( is_null( $module_id ) ) {
$module_id = isset($GLOBALS['xoopsModule']) ? $GLOBALS['xoopsModule']->getVar( 'mid', 'n' ) : 1;
} elseif ( intval($module_id) < 1 ) {
$module_id = 0;

I have confirmed database access manually, and that there is a MID record in the xoops_modules table.

I have tried reinstalling XOOPS with a new database and user as well as some modifications to the script, but have had no luck so far.

Any help is greatly appreciated.

2
ackbarr
Re: Call To A Member Function On A Non-object...

does it make any difference if you change the isAdmin function like this:

function isAdmin$module_id null ) {
    global 
$xoopsModule;
    if ( 
is_null$module_id ) ) {
        
$module_id = isset($xoopsModule) ? $xoopsModule->getVar'mid''n' ) : 1;
    } elseif ( 
intval($module_id) < ) {
        
$module_id 0;

3
MentalMuscle
Re:Call To A Member Function On A Non-object...

Unfortunately the suggestion generates the same eror on line 213.

4
onokazu
Re:Call To A Member Function On A Non-object...
  • 2004/10/15 19:26

  • onokazu

  • XOOPS Founder

  • Posts: 617

  • Since: 2001/12/13


Try changing the
isset($GLOBALS['xoopsModule'])
portion to
(isset($GLOBALS['xoopsModule']) && is_object($GLOBALS['xoopsModule']))

5
MentalMuscle
Re:Call To A Member Function On A Non-object...

The error is gone, but now I get Selected moduel does not exist!, and redirected back to the admin.php page.

6
matburnham
Re:Call To A Member Function On A Non-object...
  • 2004/11/13 20:01

  • matburnham

  • Just popping in

  • Posts: 2

  • Since: 2004/11/13


I get the same problem.

I'm running with the following setup, if its of any use to anyone.

Windows XP SP2
IIS 5.1
MySQL 4.0.22
PHP 4.3.9

Its a clean install from the xoops-2.0.7.3.tgz package. All I've done is run through the installation, and gone into the Admin section and tried to open one of the menu items.

I've tried to do this in both Internet Explorer 6 and Mozilla Firefox 1.0.

Also getting the following error:
Notice [PHP]: Undefined offset: 2 in file c:\inetpub\wwwroot\xoops\include\common.php line 267

Will report anything else I figure out to here.

Interestingly, the 2.0.9 beta reports 'Selected module does not exist!' instead of the error.

--
Mat

7
matburnham
Re:Call To A Member Function On A Non-object...
  • 2004/11/13 21:54

  • matburnham

  • Just popping in

  • Posts: 2

  • Since: 2004/11/13


I installed Apache and found that it fixed the problem. I guess this means its something to do with IIS that's breaking things.

8
fonsy
Re: Call To A Member Function On A Non-object...
  • 2004/11/22 20:33

  • fonsy

  • Just popping in

  • Posts: 1

  • Since: 2004/11/22


I have the same problem. Playing with the code, I find a solution.

In common.php, this line:

$xoopsRequestUri = $_SERVER[ 'REQUEST_URI' ];

must change REQUEST_URI for SCRIPT_NAME in order to run in IIS.

9
brash
Re: Call To A Member Function On A Non-object...
  • 2004/11/22 22:12

  • brash

  • Friend of XOOPS

  • Posts: 2206

  • Since: 2003/4/10


Weird . I know of dozens of XOOPS sites running on IIS without every having to hack the core like this, and I've been using XOOPS on IIS for coming on 2 years.

Login

Who's Online

125 user(s) are online (100 user(s) are browsing Support Forums)


Members: 0


Guests: 125


more...

Donat-O-Meter

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

Latest GitHub Commits