Jump to:

5513 Posts in 1732 Topics by 1218 members

Customising the CMS

SilverStripe Forums » Customising the CMS » CMS: somethingHasChanged=true but nothing has changed! [SOLVED]

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

Page: 1
Go to End
Author Topic: 872 Views
  • chrclaus
    Avatar
    Community Member
    29 Posts

    CMS: somethingHasChanged=true but nothing has changed! [SOLVED] Link to this post

    Hi,

    I extended a ComplexTableField and use this object in a CMS page. Everything works fine - all items are displayed correctly, all actions are working correctly. But when I click on "edit" in the CTF and close the popup without any changes and navigate to another sitetree-object, I receive the status-message that something has changed.

    Therefore, I assume that the action "edit" changes the flag "isChanged" on the Editform, but I didn´t find the code yet. Can anybody help me to understand this process?

    Best regards,
    chrclaus

  • silberfischer
    Avatar
    Community Member
    6 Posts

    Re: CMS: somethingHasChanged=true but nothing has changed! [SOLVED] Link to this post

    Hi there,

    there is a bug report that relates to this. It seems to me like there is a proposed way to work with/around this as well.

    http://open.silverstripe.org/ticket/4810

    Hope this helps.

    Regards,
    Chris

  • chrclaus
    Avatar
    Community Member
    29 Posts

    Re: CMS: somethingHasChanged=true but nothing has changed! [SOLVED] Link to this post

    Hi,

    this was a very good hint with which I found the underlying problem. There are several hidden input-fields in the ComplexTableField and both of them caused the status-message. These fields are PopupHeight and PopupWidth which are not changed at all but both of them are re-initialized after the popup is closed and the ajax-respond causes the CMS-Admin-page to update its status. During debugging I found an array of field-to-ignore this is the solution for my post. With javascript, both fields are added to this list (ArticlesComplexTableField is specialisation of ComplexTableField by me):

    ArticlesComplexTableField = Class.create();
    ArticlesComplexTableField.applyTo('#Form_EditForm div.ArticlesComplexTableField');
    ArticlesComplexTableField.prototype = {
       
       initialize: function() {
          Behaviour.register({
             
             '#Form_EditForm' : {
                changeDetection_fieldsToIgnore : {
                   'PopupHeight' : true,
                   'PopupWidth' : true
                }
             }
          });
       },   
    }

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