1
krystinevo
xHelp: Fatal error: Call to a member function

Loving Xhelp... I think it's the best thing since sliced bread.

However, I'm getting the following error when attempting to access the module:

Fatal error: Call to a member function on a non-object in /home/website/public_html/modules/xhelp/index.php on line 119

(I did search but couldn't find any mention of this error with this module.)

Thanks in advance,

Kristine

2
ackbarr
Re:xHelp: Fatal error: Call to a member function

Ding, Ding, Ding, Ding! You've found the magic bug!

Just kidding. This is the first I'd seen of this error as well. After looking at the code, it looks like you have a ticket that was submitted by a user that has been deleted.

the current line 119 looks like this:
'uname'=>$user->getVar('uname'),


Try this line in its place:
'uname'=>(isset($user)?$user->getVar('uname'):$xoopsConfig['anonymous']),


I imagine that the same assumption will crop up in other places in xhelp, so consider this a stop-gap solution until I can test the rest of the application.

3
ackbarr
Re:xHelp: Fatal error: Call to a member function

I added a request to the Bug Tracker on dev.xoops.org to keep track of this issue:

[ #1296 ] Fatal Error when submitter user account is deleted

* Update - I have submitted a fix to CVS in both the xhelp_0_6 and HEAD branches.

4
krystinevo
Re:xHelp: Fatal error: Call to a member function

Thank you Ackbarr...

I replaced the code snippet on line 119 and also on line 312, (because it's the same piece of code and I was getting the same error for that line) and after updating the module, I'm still getting the same error on both lines (depending on whether I attempt to access the module via the main menu or a block).

Am I missing a step?

Thanks again,

Kristine

(I'm also getting the following PHP error within the module admin page:

Warning [PHP]: Division by zero in file modules/xhelp/admin/index.php line 697
Warning [PHP]: Division by zero in file modules/xhelp/admin/index.php line 697)

5
ackbarr
Re:xHelp: Fatal error: Call to a member function

here is the line I used to fix the problem in the next release:
'uname'=>(($user)?$user->getVar('uname'):$xoopsConfig['anonymous']),

Login

Who's Online

447 user(s) are online (345 user(s) are browsing Support Forums)


Members: 0


Guests: 447


more...

Donat-O-Meter

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

Latest GitHub Commits