I have put two relation_n_n in the form, why are saved only data of a relation_n_n?
1) $crud->set_relation_n_n('strutture', 'vnt_relazioni', 'vnt_strutture', 'idMultimedia', 'idStruttura', 'ramo');
2) $crud->set_relation_n_n('contenuti', 'vnt_relazioni', 'vnt_contenuti', 'idMultimedia', 'idContenuto', 'titolo','posizione');
only the second relations is saved.
if you comment a set_relation_n_n, the other is properly saved.
two relation_n_n not work
Started by vnt, 22 February 2012 - 14:15 PM
- Single Page
Posted 22 February 2012 - 14:15 PM
Posted 22 February 2012 - 23:34 PM
Yes this is because the [color=#282828][font=helvetica, arial, sans-serif]vnt_relazioni is the same. In general it works with two or more set_relation_n_n but it never happens to have the middle table the same name. I don't want to make my code more complicated for this scenario, are you sure that your database structure is right? For me as I see it you must have two different tables so it will be:[/font][/color]
[color=#282828][font=helvetica, arial, sans-serif]
[color=#282828][font=helvetica, arial, sans-serif]I log this as an issue ( [/font][/color]https://github.com/scoumbourdis/grocery-crud/issues/11[color=#282828][font=helvetica, arial, sans-serif] ) to fix it when I will have time. [/font][/color]
[color=#282828][font=helvetica, arial, sans-serif]
[/font][/color]
$crud->set_relation_n_n('strutture', 'vnt_relazioni', 'vnt_strutture', 'idMultimedia', 'idStruttura', 'ramo');
$crud->set_relation_n_n('contenuti', 'vnt_relazioni2', 'vnt_contenuti', 'idMultimedia', 'idContenuto', 'titolo','posizione');
[color=#282828][font=helvetica, arial, sans-serif]I log this as an issue ( [/font][/color]https://github.com/scoumbourdis/grocery-crud/issues/11[color=#282828][font=helvetica, arial, sans-serif] ) to fix it when I will have time. [/font][/color]