Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

PHP Warnings on top of CMS page, won't go away


Reply


5 Posts   1620 Views

Avatar
D.K.

Community Member, 20 Posts

8 May 2010 at 5:25am

I'm getting "Warning: Call-time pass-by-reference has been deprecated; 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 in /home/.halcyon/dkulchenko/portools.com/ss/forum/code/ForumHolder.php on line 648" at the beginning of each page of the CMS (running SS 2.4, and trunk Forum, by the way). I don't have access to php.ini, I'm on shared hosting. I tried setting error_reporting(0) in both mysite/_config.php and even index.php, but the warning just won't go away. What do I do?

Avatar
D.K.

Community Member, 20 Posts

8 May 2010 at 6:58am

I've managed to temporarily fix it by directly hacking Core.php in sapphire to force error_reporting to 0 always, but it doesn't seem like the cleanest way to do this...

Avatar
mathiasmex

Community Member, 28 Posts

7 July 2010 at 7:45am

Edited: 07/07/2010 7:51am

I face the same problem right now.
Following warning on clean 2.4 and lates forum trunk install:

Warning: Call-time pass-by-reference has been deprecated in /www/forum/code/ForumHolder.php on line 696.

Line 696 reads:

$this->getNewPostsAvailable(null, null, $forumID, $threadID, &$data);

If I set

$this->getNewPostsAvailable(null, null, $forumID, $threadID, $data);

(note the missing ampersand on $data), then the warning goes away. Function involved is rss().

Maybe someone could explain the reason of this ampersand ?

Thank you

Edit: this should actually be in Forum "Forum Module"...

Avatar
Hamish

Community Member, 712 Posts

7 July 2010 at 3:32pm

The function definition for getNewPostsAvailable includes the reference so it is safe to remove the ampersand in line 696.

Avatar
mathiasmex

Community Member, 28 Posts

7 July 2010 at 7:41pm

Hamish,

thanks for confirmation. I appreciate the quick response.

Mathias