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.

Form Questions /

(none) when content is '0'


Reply


3 Posts   971 Views

Avatar
Redwood

Community Member, 2 Posts

11 October 2009 at 9:51am

Edited: 11/10/2009 9:52am

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

Avatar
dalesaurus

Community Member, 283 Posts

13 October 2009 at 1:14pm

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

Avatar
Redwood

Community Member, 2 Posts

14 October 2009 at 7:22am

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