Jump to:

2011 Posts in 1436 Topics by 620 members

Form Questions

SilverStripe Forums » Form Questions » (none) when content is '0'

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

Page: 1
Go to End
Author Topic: 942 Views
  • Redwood
    Avatar
    Community Member
    2 Posts

    (none) when content is '0' Link to this post

    Using version 2.3.3

    When the value of a ReadonlyField is set to '0', it shows up as '(none)' in the form.
    This is because in FormField.php, the Field function starts like this:
       function Field() {
          if($this->value) ...
    I changed it to
          if(isset($this->value))
    to get it to work.

    This seems systemic in *Field.php; I saw it everywhere '(none)' was being generated.
    Is this a bug or the desired behavior?

    [I've just been using SilverStripe/Sapphire for a month now, and I love it! Even the unusual things I've tried that were painful to get working in Drupal fit right in to your system. Thanks so very much! I hope I will have modules to contribute back.]

  • dalesaurus
    Avatar
    Community Member
    283 Posts

    Re: (none) when content is '0' Link to this post

    This seems like an unexpected bug, the use of forcing PHP_NOTICE's makes us SS dev's very aware of the isset() function. You will likely want to seach/log it in Trac http://open.silverstripe.org

  • Redwood
    Avatar
    Community Member
    2 Posts

    Re: (none) when content is '0' Link to this post

    Thanks for the link. I've logged it in Trac.

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