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

Debugging in SilverStripe


Reply

5 Posts   358 Views

Avatar
Raver0124

15 October 2013 at 5:49pm (Last edited: 15 October 2013 6:19pm), Community Member, 8 Posts

Hi guys,

I'm new to SilverStripe and i can't seems to get the debugging working.

So far i've done
/mysite/_config/config.yml

Director: environment_type: 'dev'

in code

Debug::show($data);

url

http://someUrl/page?isDev=1
http://someUrl/page?debug=1
http://someUrl/page?dev=1

But i can't seem to get it to work.
am i missing?

Also should I be expecting something on the screen?

Avatar
swaiba

15 October 2013 at 10:32pm Forum Moderator, 1796 Posts

Hi Raver0124,

The key might be...

"in code... Debug::show($data);"

It depends where - if your code isn't executed then it will never show output. I tend to place this in the page controller init of the page I'm looking to check debug output is working as that part is always called.

Avatar
Raver0124

15 October 2013 at 11:08pm Community Member, 8 Posts

Hi Swaiba,

Thank you for your reply, i did further testing and it seems the problem is at

Director: environment_type: 'dev'


I might not be declaring at the right place.
If I remove the if condition in the debug.php (under function show()), then it works.

"/mysite/_config/config.yml"
Is this the correct place to declare this?

Avatar
swaiba

15 October 2013 at 11:10pm Forum Moderator, 1796 Posts

To be sure to be sure to be sure add this to your _Config.php

Director::set_environment_type('dev');

Avatar
Raver0124

16 October 2013 at 1:46am Community Member, 8 Posts

Thank you for your reply again,
Now i'm getting following error

[User Deprecated] DataObjectDecorator is deprecated. DataObjectDecorator is deprecated. Use DataExtension instead. Called from ReflectionClass->newInstance.

hmmm weird, I'm not using any reflection in this class.
any idea?

I'll try debug in details tomorrow