Jump to:

22984 Posts in 11765 Topics by 2827 members

General Questions

SilverStripe Forums » General Questions » Debugging in SilverStripe

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: 266 Views
  • Raver0124
    Avatar
    Community Member
    8 Posts

    Debugging in SilverStripe Link to this post

    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?

  • swaiba
    Avatar
    Forum Moderator
    1769 Posts

    Re: Debugging in SilverStripe Link to this post

    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.

  • Raver0124
    Avatar
    Community Member
    8 Posts

    Re: Debugging in SilverStripe Link to this post

    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?

  • swaiba
    Avatar
    Forum Moderator
    1769 Posts

    Re: Debugging in SilverStripe Link to this post

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

    Director::set_environment_type('dev');

  • Raver0124
    Avatar
    Community Member
    8 Posts

    Re: Debugging in SilverStripe Link to this post

    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

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