Ticket #1027 (closed Bug: worksforme)

Opened 16 months ago

Last modified 8 months ago

Warning: Call-time pass-by-reference has been deprecated

Reported by: EK_123 Owned by:
Priority: Normal Milestone:
Component: Project : MediaWiki+FCKeditor Version:
Keywords: Cc:

Description

Hello,

I getting the following warning when I install FCKeditor into mediawiki 1.10.1:

Warning: Call-time pass-by-reference has been deprecated - argument passed by value; If you would like to pass it by reference, modify the declaration of [runtime function name](). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file. However, future versions may not support this any longer. in C:\EasyPHP\www\mediawiki\extensions\FCKeditor\FCKeditorParser.body.php on line 173

Can someone help me to solve this? All your help will be much appreciated! Thanks

Change History

in reply to: ↑ description   Changed 16 months ago by EK_123

Solved this by replacing

$parserOutput = parent::parse($text, &$title, $options, $linestart , $clearState , $revid );

into

$parserOutput = parent::parse($text, $title, $options, $linestart , $clearState , $revid );

Replying to EK_123:

Hello, I getting the following warning when I install FCKeditor into mediawiki 1.10.1: Warning: Call-time pass-by-reference has been deprecated - argument passed by value; If you would like to pass it by reference, modify the declaration of [runtime function name](). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file. However, future versions may not support this any longer. in C:\EasyPHP\www\mediawiki\extensions\FCKeditor\FCKeditorParser.body.php on line 173 Can someone help me to solve this? All your help will be much appreciated! Thanks

follow-up: ↓ 4   Changed 16 months ago by wwalc

  • status changed from new to closed
  • resolution set to fixed

I also fixed it in SVN.
Thanks!

  Changed 16 months ago by fredck

  • priority changed from High to Normal

in reply to: ↑ 2   Changed 16 months ago by EK_123

Forgot to tell this:

Replace

function parse( $text, &$title, $options, $linestart = true, $clearState = true, $revid = null ) {

$parserOutput = parent::parse($text, &$title, $options, $linestart , $clearState , $revid );

with

function parse( $text, $title, $options, $linestart = true, $clearState = true, $revid = null ) {

$parserOutput = parent::parse($text, $title, $options, $linestart , $clearState , $revid );

(it is about the first line, I forgot to change that one also. If you do not change, you will have problem saving new pages.)

Replying to wwalc:

I also fixed it in SVN.
Thanks!

  Changed 16 months ago by fredck

  • status changed from closed to reopened
  • resolution fixed deleted

follow-up: ↓ 7   Changed 16 months ago by wwalc

Do you encounter any errors if there is &$title in the first line?

This is original declaration in Parser.php

public function parse( $text, &$title, $options, $linestart = true, $clearState = true, $revid = null ) {

...so same declaration should be in FCKeditorParser (with &$title).

The problem was that only in the line, where we were passing $title by reference: $parserOutput = parent::parse($text, &$title, $options, $linestart , $clearState , $revid ); (although title already has been declared to be passed by reference).

Please correct me if I missed something.

in reply to: ↑ 6   Changed 16 months ago by EK_123

Yes, I do, that is why I replied again. I had to remove the "&" from the first line as well. If I dont do this, I cannot save pages anymore.

Replying to wwalc:

Do you encounter any errors if there is &$title in the first line? This is original declaration in Parser.php public function parse( $text, &$title, $options, $linestart = true, $clearState = true, $revid = null ) { ...so same declaration should be in FCKeditorParser (with &$title). The problem was that only in the line, where we were passing $title by reference: $parserOutput = parent::parse($text, &$title, $options, $linestart , $clearState , $revid ); (although title already has been declared to be passed by reference). Please correct me if I missed something.

follow-up: ↓ 9   Changed 16 months ago by wwalc

I can't reproduce this error... could you let me know does any PHP error show up when &$title is in function declaration? (when saving page fails)

in reply to: ↑ 8   Changed 16 months ago by EK_123

I just get a "Page not found" error. I tried everything, but nothing helped except removing the "&" (from title) from the first line.

  Changed 9 months ago by w.olchawa

  • keywords Pending added

  Changed 9 months ago by fredck

  • keywords Pending removed

  Changed 8 months ago by wwalc

  • status changed from reopened to closed
  • resolution set to worksforme

Sorry, I'm closing this as "worksforme" because I can't reproduce it (with allow_call_time_pass_reference = Off set in php.ini).

Changing $title into &$title in function declaration can't produce "Page not found" error, there must some additional thing that causes this error in your installation, check error log.

Declaration used in FCKeditorParser.body.php

parse( $text, &$title, $options, $linestart = true, $clearState = true, $revid = null )

is the same as in includes/Parser.php so there shouldn't be any problems with it.

Note: See TracTickets for help on using tickets.