⚠ In case you've missed it we are migrating to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This forum is read-only and soon will be archived. ⚠

Beware with set_relation_n_n

beware set_relation_n_n

  • Please log in to reply
No replies to this topic

#1 Amit Shah

Amit Shah

    grocery CRUD Master

  • Advanced Member
  • PipPipPip
  • 1,192 posts

Posted 02 October 2014 - 07:29 PM

Hello team GC.


I was in an encounter with a haunted situation / scenario where i have had conditional fields and stuff... where 1 field was supposed to be an in relation with n_n with another table.


Now what i ended up with was .. writing a conditional where i didnt set that field in for edit (that was not required for the situation) but i unexpectedly added set_relation_n_n with that field (the one that didnt exist in the field list)


Now what used to happen - when i saved a record, it ended up deleting the entries from the n_n relation table. And it was super haunting as i never ever have had written a code to delete it...


It took up quite a number of hours of mine to determine that this was a delete that was being caused up by adding an unnecessary set_relation_n_n to a field that was not in configuration...


I lost up a lot of hours for that.. but you can be aware by this scenario and save your hours and data.


I hope Web Johny will come up with a solution some day ... I will try to provide if possible as for now i am not in a position .. due to my time...


Happy GCing to all of you my fellow coders.

Also tagged with one or more of these keywords: beware, set_relation_n_n

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users