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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

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

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

Debugging in SilverStripe


Go to End


5 Posts   1180 Views

Avatar
Raver0124

Community Member, 8 Posts

15 October 2013 at 5:49pm

Edited: 15/10/2013 6:19pm

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

Forum Moderator, 1899 Posts

15 October 2013 at 10:32pm

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

Community Member, 8 Posts

15 October 2013 at 11:08pm

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

Forum Moderator, 1899 Posts

15 October 2013 at 11:10pm

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

Director::set_environment_type('dev');

Avatar
Raver0124

Community Member, 8 Posts

16 October 2013 at 1:46am

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