1
Theophilus7
Making a module for the first time : strange error

Hello,

I've more or less got the hand of using XOOPS as a webmaster, but now I want to start making some of my own modules - only simple ones, for the moment. The only documentation I could find seemed a bit scanty and incomplete (any good tutorials out there?). I decided to make a tentative and exploratory start using the "RandomQuotes" module provided on this site, so I would have something relatively simple to work with. Unfortunately, the new module I have made (which doesn't actually do anything at the moment) seems to be dependent on RandomQuotes in some way. After de-installing RandomQuotes, I get the following error when I try to access the new module's admin:

Fatal error: Call to a member function on a non-object in C:\FoxServ\www\TestZone\modules\newmodule\admin\admin_header.php on line 18

The code that is causing the error is, apparently, this:

Quote:

if ( !$xoopsUser->isAdmin($xoopsModule->mid()) )


(I presume this line of code is making sure that it is only an administrator who is gaining access to the admin of this new module).

This doesn't happen when RandomQuotes is installed.

Looking through the files, it seems everything has been included that should have been - the only alterations I have made so far have been to the language files and various bits of text (eg. describing the module, giving the author's name etc.)

Any ideas what I have done wrong?

2
adrock
Re: Making a module for the first time : strange error
  • 2005/9/4 10:54

  • adrock

  • Quite a regular

  • Posts: 291

  • Since: 2004/12/7


as odd as it may sound, this part of the error
Quote:
Fatal error: Call to a member function on a non-object

is really what it is trying to say...
that line of code is where it starts...but it has no 'complaint' about that line...
the 'complaint' is about what that line of code is pertaining to...

so, it starts with an 'if' statement...and then goes into some instructions based on that statement, and then probably provides an alternative set of instructions if the conditions of the first statement are not met.

(in other words look after that line of code for the problem)

Good Luck!
Affordable Web Hosting - Family - Fun!...and not always in that order!

Login

Who's Online

145 user(s) are online (81 user(s) are browsing Support Forums)


Members: 0


Guests: 145


more...

Donat-O-Meter

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

Latest GitHub Commits