⚠ In case you've missed it, we have migrated 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 is an archived forum. ⚠

  •     

profile picture

Error when Adding, Updating Crud with Set Relation N N



Terence Vusile Silonda
  • profile picture
  • Member

Posted 03 September 2013 - 17:13 PM

Hi,

 

I'm getting an error when doing insertion to a crud which has set_relation_n_n.

 

  • When I insert: I get "An Error Has Occurred on Insert"
  • When I update: All other information on the table gets updated with an exception of the n_n relation. I can delete items from the n_n, but I can not add new ones. 

What could be the cause of this error?

 


chavamm
  • profile picture
  • Member

Posted 03 September 2013 - 17:55 PM

Hi, maybe we could help you better if you post the code of your controller.

Regards!


Terence Vusile Silonda
  • profile picture
  • Member

Posted 03 September 2013 - 20:35 PM

Hi Chavamm, I'm pretty sure it's not the controller, because all the set_relation_n_n used to work... Now they all don't work.


davidoster
  • profile picture
  • Member

Posted 04 September 2013 - 03:29 AM

[member=terence vusile silonda] first of all which version do you use?

Also when you mention "used to" what do you mean? What has changed since the used to?


Terence Vusile Silonda
  • profile picture
  • Member

Posted 04 September 2013 - 06:13 AM

davidoster, I use version CodeIgniter Version 2.1.3. and Grocery Crud Library is version 1.3, model is 1.2, 

 

I honestly have no idea what has changed. I've been playing mostly with my Controllers and Models. I haven't touched any of the Grocery Crud Files. This error only occurs in CRUDs where I have used set_relation_n_n. 


davidoster
  • profile picture
  • Member

Posted 04 September 2013 - 08:33 AM

Post the controller's function that you use the n_n along with the tables' structure so we can have a better look on this.


Terence Vusile Silonda
  • profile picture
  • Member

Posted 04 September 2013 - 13:18 PM

davidoster... Before I post any code or table structures, I just want to let you know that it's on ALL CRUDS that I use set_relation_n_n. I have like 5 of these. And all are suddenly not working. This is in my localhost. I have a version on line, that's working perfectly, I even tried to replace the controllers with the on line version, but the problem still persists on the localhost.