Ticket #1027 (closed Bug: worksforme)

Opened 7 years ago

Last modified 6 years 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

comment:1 in reply to: ↑ description Changed 7 years 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

comment:2 follow-up: ↓ 4 Changed 7 years ago by wwalc

  • Status changed from new to closed
  • Resolution set to fixed

I also fixed it in SVN.
Thanks!

comment:3 Changed 7 years ago by fredck

  • Priority changed from High to Normal

comment:4 in reply to: ↑ 2 Changed 7 years 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!

comment:5 Changed 7 years ago by fredck

  • Status changed from closed to reopened
  • Resolution fixed deleted

comment:6 follow-up: ↓ 7 Changed 7 years 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.

comment:7 in reply to: ↑ 6 Changed 7 years 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.

comment:8 follow-up: ↓ 9 Changed 7 years 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)

comment:9 in reply to: ↑ 8 Changed 7 years 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.

comment:10 Changed 7 years ago by w.olchawa

  • Keywords Pending added

comment:11 Changed 6 years ago by fredck

  • Keywords Pending removed

comment:12 Changed 6 years 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.
© 2003 – 2012 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy