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

Disabling Warnings and Notices when logged in as admin


Reply

4 Posts   1731 Views

Avatar
Andre

1 October 2010 at 6:42am Community Member, 126 Posts

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?

Avatar
Martijn

1 October 2010 at 8:12am Community Member, 271 Posts

Have you set site mode to live?

Director::set_environment_type('live');

Avatar
swaiba

1 October 2010 at 11:19pm Forum Moderator, 1796 Posts

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');
}

Avatar
Andre

2 October 2010 at 7:46am Community Member, 126 Posts

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.