⚠ 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 forum is read-only and soon will be archived. ⚠

[Solved] Add and Edit errors

set_relation_n_n add edit errors debugging

  • Please log in to reply
No replies to this topic

#1 voghDev



  • Members
  • PipPip
  • 20 posts

Posted 21 May 2014 - 11:37 AM

I have two tables, and a set_relation_n_n beetween them:



Museum: id, name, ...

Category: id, name, ...

Museum_x_Category: museum_id, category_id

The relation is defined by this line:



$crud->set_relation_n_n('Categorías', 'Museum_x_Category', 'Category', 'museum_id', 'category_id', 'name', 'category_id' );


I was getting these "An error ocurred on insert" and "An error has occurred on saving." errors when adding or editing.


The cause was: the non-utf8 character in the word 'Categorías'. Replacing this word by 'Categorias' (note the í), it works.


Also, i had to remove the last parameter 'category_id', because it was assigning me all the museums to the first category (id=1). Gotta do some research to understand this behavior of GroceryCRUD. Probably it is correct.


So now, it works.


Hope my solutions save time to anybody else.

Also tagged with one or more of these keywords: set_relation_n_n, add, edit, errors, debugging

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users