Jump to:

23355 Posts in 17838 Topics by 2862 members

General Questions

SilverStripe Forums » General Questions » Disabling Warnings and Notices when logged in as admin

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: 1652 Views
  • Andre
    Avatar
    Community Member
    126 Posts

    Disabling Warnings and Notices when logged in as admin Link to this post

    Hi, I'm haveing a Problem with a Warning thrown when trying to add a new ImageGalleryPage.

    It's nothing more than a stupid warning, so i tried to disable warnings and set error_reporting to 0. phpinfo() shows me that error reporting is off, but if I am in the Admin Backend, it seems that error reporting gets reactivatet through ini_set function somewhere inside the code.

    So is there a static which I can add to my _config.php to deactivate error_reporting when admin user?

  • Martijn
    Avatar
    Community Member
    271 Posts

    Re: Disabling Warnings and Notices when logged in as admin Link to this post

    Have you set site mode to live?

    Director::set_environment_type('live');

  • swaiba
    Avatar
    Forum Moderator
    1784 Posts

    Re: Disabling Warnings and Notices when logged in as admin Link to this post

    I place the following in the _config.php so that when in dev mode I get all the logging and templates refreshed...

    if (Director::isDev()) {
       ini_set('display_errors', 1);
       error_reporting(E_ALL);
       SSViewer::flush_template_cache();
       Debug::log_errors_to('err.log');
    }

  • Andre
    Avatar
    Community Member
    126 Posts

    Re: Disabling Warnings and Notices when logged in as admin Link to this post

    Hi, thanks for your replies, but tha actually didn't solved my Problem.

    My Problem is described more detailed in the following Post:
    http://ssorg.bigbird.silverstripe.com/all-other-modules/show/250910?showPost=293108

    I get a PHP Warning on adding a new ImageGalaryPage. The warning is thrown by the rename function, because the directory to renam does not exist. I am logged in as admin to the Silverstripe Backend so, it seems, this is the reason why the Warning is shown instead of just ignoring it. All changes of error_reporting to 0 in php.ini or .htacces didn't switch of warnings when logged in as admin.

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