Jump to:

23490 Posts in 18996 Topics by 2878 members

General Questions

SilverStripe Forums » General Questions » Bug? Form field's title parameter using a DBField name

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: 264 Views
  • thi3r
    Avatar
    Community Member
    25 Posts

    Bug? Form field's title parameter using a DBField name Link to this post

    Hi,

    Just came across a strange behaviour while adding CMS fields (SS 2.4.6).

    When a NumericField or TexField (the only ones I have texted) with the title parameter equal to a DBField name, the form field is skipped from the CMS interface with no error or warning.

    In my case, I had:

    static $db = array (
    'ImagesDisplayOrder' => 'Int(1)'
    );
    static $has_many = array(
    'Images' => 'ImagePiece'
    );

    /* ... */

    $fields->addFieldToTab("Root.Content.Main", new NumericField('ImagesDisplayOrder', "Images")); // not displayed in CMS
    $fields->addFieldToTab("Root.Content.Main", new NumericField('ImagesDisplayOrder', "Pictures")); // works as expected

    Not sure if this is a bug, but I can't find any other explication as it shouldn't matter what's in the title attribute?
    Can anybody replicate this?

    Thanks, Thierry

  • martimiz
    Avatar
    Forum Moderator
    1086 Posts

    Re: Bug? Form field's title parameter using a DBField name Link to this post

    oops - wrong post, sorry...

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