1
Walrick
Fatal error: Only variables can be passed by reference
  • 2006/7/3 9:39

  • Walrick

  • Just popping in

  • Posts: 6

  • Since: 2006/6/30


Hello,

I keep running into white pages which, with debugging turned on, return:

Quote:
Fatal error: Only variables can be passed by reference


Followed by some file name and line number.

This happens to me all the time when trying to view the userinfo:
Quote:
xoops/userinfo.php on line 115


It also happens on the top page with a custom block:
Quote:
xoops/class/xoopsblock.php on line 152


And with at least two modules: WF-Channels and Liaise

This seems to be a bug in PHP, see here. However, it doesn't seem likely that this will be fixed anytime soon. Note the status field on the linked page above.

I can work around this by not using the problematic modules and such, but although I can do well without WF-Channel the two problems with the XOOPS core (userinfo and custom block) are a nuisance.

So a more definite solution would be appreciated.

I use php 5.0.5. by the way. It's a hosted domain, so I can't change anything about that.
The problem seems to be independent of theme choice.

Let me know if you need any more information. And of course a fix would be highly appreciated. Even a fix I can do myself, as long it comes with clear instructions (like replace ‘this’ with ‘that’ in that file on that line), as I don’t know much about php.

Thanks in advance for any help.

Regards,

Walrick
Netherlands

2
snow77
Re: Fatal error: Only variables can be passed by reference
  • 2006/7/3 9:54

  • snow77

  • Just can't stay away

  • Posts: 864

  • Since: 2003/7/23


what XOOPS version are you running?

try uploading all core files (everything except mainfile.php mainly ...and other things you may not want to overwrite)

always look for the modules with most maintenance in xoops... not sure if wf_channel could be one of them.

specifically where does your fatal error appear?

3
Walrick
Re: Fatal error: Only variables can be passed by reference
  • 2006/7/3 10:03

  • Walrick

  • Just popping in

  • Posts: 6

  • Since: 2006/6/30


I run version 2.0.14.

Like I said it occurs on in the top page with a custum block, and when viewing user info (like clicking on "view account").

I could upload the files again, but I doubt that'll help. It doesn't sound like a corrupt file to me. It's a php bug, which leads to problems with some functions. If you do a search on this site, you'll find the problem more often, including some fixes for other modules. But not for these core parts I believe.

Walrick

4
snow77
Re: Fatal error: Only variables can be passed by reference
  • 2006/7/3 10:12

  • snow77

  • Just can't stay away

  • Posts: 864

  • Since: 2003/7/23


I'm seeing everything ok until now, could you give an URL to the problem?

5
Walrick
Re: Fatal error: Only variables can be passed by reference
  • 2006/7/3 10:28

  • Walrick

  • Just popping in

  • Posts: 6

  • Since: 2006/6/30


Quote:

snow77 wrote:
I'm seeing everything ok until now, could you give an URL to the problem?


The parts that have probems are either invisible or disabled or for registered users only. And I have to go now, so can't change anything atm. Plus the server seems to be offline or something. I'll have to get back to this in a couple of hours when I'm back.

Then I'll post an URL.

6
Walrick
Re: Fatal error: Only variables can be passed by reference
  • 2006/7/3 14:34

  • Walrick

  • Just popping in

  • Posts: 6

  • Since: 2006/6/30


You can see the error here:

http://www.walrick.net/xoops/userinfo.php?uid=1

Walrick

7
leostotch
Re: Fatal error: Only variables can be passed by reference
  • 2006/7/3 15:03

  • leostotch

  • Just popping in

  • Posts: 76

  • Since: 2006/4/1 1


Quote:
So a more definite solution would be appreciated.
I use php 5.0.5. by the way. It's a hosted domain, so I can't change anything about that.


It's a problem specific to PHP 5.0.x. As the change they did broke some applications, the PHP team decided to fix this in 5.1, but didn't in 5.0 .

The fix is easy each time, but fixing one line doesn't mean you won't see the same problem reappear in another one (however: the way to fix it is the same each time). So I think you'd better report this to the devs so they can provide a real fix.

In the meantime, here's the idea:
// userinfo.php (115)
$xoopsTpl->assign('user_extrainfo'$myts->makeTareaData4Show([color=FF6666]$thisUser->getVar('bio''N')[/color],0,1,1));
// xoopsblock.php (152)
return str_replace('{X_SITEURL}'XOOPS_URL.'/'$myts->displayTarea([color=FF6666]$this->getVar('content''N')[/color], 11));

you have to put the result of 'getVar' in a temporary variable each time, changing those line to this:
// userinfo.php (115)
$tmp $thisUser->getVar('bio''N');
$xoopsTpl->assign('user_extrainfo'$myts->makeTareaData4Show($tmp,0,1,1));
// xoopsblock.php (152)
$tmp $this->getVar('content''N');
return 
str_replace('{X_SITEURL}'XOOPS_URL.'/'$myts->displayTarea($tmp11));


But again, there may be others (opening userinfo.php made me see the same syntax was used for 'user_signature' a few lines below ), so you'll have to do this each time

8
Walrick
Re: Fatal error: Only variables can be passed by reference
  • 2006/7/3 18:57

  • Walrick

  • Just popping in

  • Posts: 6

  • Since: 2006/6/30


Thanks!

I'll do three things.

1. Report this to the devs (I asume you mean through the "Report Core Bug" option?)

2. Try to get my hosting provier to upgrade to 5.1

If he doesn't or that doesn't solve the problem:

3. Do the fix myself manually.

But again: thanks a lot!

Walrick

Login

Who's Online

321 user(s) are online (239 user(s) are browsing Support Forums)


Members: 0


Guests: 321


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