Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » "Fields_fields" has no properties

Our old forums are still available as a read-only archive.

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

Page: 1
Go to End
Author Topic: 1255 Views
  • xmedeko
    Avatar
    Community Member
    94 Posts

    "Fields_fields" has no properties Link to this post

    Hi,

    create a new contact form, do not change anything, just click "Form" tab. Then go to any other (plain) page, make some changes and do 'Save Draft'. The draft is not saved and in the Error console is:

    Error: $("Fields_fields") has no properties
    Source File: http://10.1.1.100/xebidy/sapphire/javascript/FieldEditor.js
    Line: 33

    I use FF 2.0.0.4. The following patch seems to solve this problem for me.

    --- FieldEditor.js.orig 2007-06-07 09:22:20.000000000 +1200
    +++ FieldEditor.js 2007-06-07 09:25:00.000000000 +1200
    @@ -29,14 +29,17 @@
    },
    beforeSave: function() {
    this.sortFields();
    +
    + var fieldEditor = $('Fields_fields');
    + if(fieldEditor) {
    + var children = fieldEditor.childNodes;

    - var children = $('Fields_fields').childNodes;
    -
    - for( var i = 0; i < children.length; ++i ) {
    - var child = children;
    + for( var i = 0; i < children.length; ++i ) {
    + var child = children;

    - if( child.beforeSave )
    - child.beforeSave();
    + if( child.beforeSave )
    + child.beforeSave();
    + }
    }
    },

  • Sean
    Avatar
    Forum Moderator
    921 Posts

    Re: "Fields_fields" has no properties Link to this post

    This is good - the problem is there's a bunch of JS files in SilverStripe that haven't had any if() blocks wrapped around assumptions that these variables exist.

    I'll take note of this, and make sure this reaches either our next release (2.0.2) or the one after that, but I don't see it being a huge change that's going to be causing bugs all over the place.

    Cheers,
    Sean

  • xmedeko
    Avatar
    Community Member
    94 Posts

    Re: "Fields_fields" has no properties Link to this post

    Hm, I see the problem is more deeper, so my fix as just workaround, not the real fix. There's an observeMethod('BeforeSave'...) and this observation has to be stopped, when the user clicks to another page.

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