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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Customising the CMS /

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

Many_many saving problems: bug or my code?


Go to End


2 Posts   2052 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 here) and ProductStyle.php (see here. I use them in a many_many relationship on ProductPage.php, here. 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...