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 /

Many_many saving problems: bug or my code?


Reply


2 Posts   1147 Views

Avatar
SilverRay

Community Member, 167 Posts

12 January 2009 at 1:36pm

Hi all,

The following is kind of driving me nuts! :) I thought this to be gone in 2.3 rc2 but it is still there. However it is probably my code. Because I have to post code from three files, I will use pastie, otherwise this post will get too long.

I have two dataobjects: NormalColor.php (see [url=http://pastie.org/358316]here[/url]) and ProductStyle.php (see [url=http://pastie.org/358318]here[/url]. I use them in a many_many relationship on ProductPage.php, [url=http://pastie.org/358319]here[/url]. This seems to work. But not always. In the CMS, when I click on the checkboxes in the tablefields, sometimes it is not saved in the database. Or some are saved. It varies. I had this problem with earlier versions of Silverstripe as well. It feels like it is some problem with the javascript for the complex table field (on the CMS side in the browser I mean), but I'm not sure. Perhaps it is something weird in my code. It happens even with a clean install of the CMS. Needless to say, this can be a challenge for a client using the admin interface. Anybody experiencing this also? Does my code need fixing?

Help much appreciated, thanks!

Ray.

Avatar
SilverRay

Community Member, 167 Posts

12 January 2009 at 2:15pm

Update: problem improves when I reload the flushed CMS (with admin?flush=1) every time *before* I make and save a change in either table... improves, but not 100% of the time...