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.

Customising the CMS /

CMS: somethingHasChanged=true but nothing has changed! [SOLVED]


Reply


3 Posts   958 Views

Avatar
chrclaus

Community Member, 29 Posts

3 May 2010 at 8:50pm

Edited: 15/05/2010 8:18am

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

Avatar
silberfischer

Community Member, 6 Posts

11 May 2010 at 8:56pm

Edited: 11/05/2010 8:56pm

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

Avatar
chrclaus

Community Member, 29 Posts

15 May 2010 at 8:15am

Edited: 15/05/2010 8:17am

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
            }
         }
      });
   },   
}