Jump to:

23487 Posts in 18996 Topics by 2878 members

General Questions

SilverStripe Forums » General Questions » PHP Warnings on top of CMS page, won't go away

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

Page: 1
Go to End
Author Topic: 1489 Views
  • D.K.
    Avatar
    Community Member
    20 Posts

    PHP Warnings on top of CMS page, won't go away Link to this post

    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?

  • D.K.
    Avatar
    Community Member
    20 Posts

    Re: PHP Warnings on top of CMS page, won't go away Link to this post

    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...

  • mathiasmex
    Avatar
    Community Member
    28 Posts

    Re: PHP Warnings on top of CMS page, won't go away Link to this post

    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"...

  • Hamish
    Avatar
    Community Member
    712 Posts

    Re: PHP Warnings on top of CMS page, won't go away Link to this post

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

  • mathiasmex
    Avatar
    Community Member
    28 Posts

    Re: PHP Warnings on top of CMS page, won't go away Link to this post

    Hamish,

    thanks for confirmation. I appreciate the quick response.

    Mathias

    1489 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.