Unwanted add during add through an n:m relation
-
Hi Peter,
tanks for helping with the “Error Message during add” topic, solved by patch three days ago.
Now from that, I have the following issue:
When editing a Music-Event (base table) I refer to a Songlist (called relation table with multiple songlists inside) through a List-of-Songlists table (called target table, for me the glue, the link between both).
When I add a song to a Songlist, the plugin attempts to not only add a new song to the Songlist, but in parallel a new List-of-Songlists entry, referring to the new song. I prevented that by making the related List-of-Songlist column unique, which generates the error message you corrected to be properly displayed with the above patch [ERROR: Error create relationship (insert failed)].
However, the Songlist has properly been amended and everything looks fine, except the error message (i.e., the plugin obviously first adds the song in the target list and then tries to add an entry inside the link (middle) table, which doesn’t work due to ‘unique’.
Now, when it comes to deleting a song, it will not work, as your plugin comes up with an error message [ERROR: Could not delete row].
Some of my starting thoughts:
In an n:m, you can only delete relationships, in 1:n you can delete the item itself.
This may be one path for better understanding, however, what is then the idea behind ADD instead of ADD EXISTING in an n:m relation?Of course, I could add and delete a song by other means, either directly in the Songlist or through an 1:n link in the List-of-Songlists table, but I still do not see the good reason, why the plugin would behave like this with the middle (called target, for me the glue, the linking) table.
I am probably totally wrong in my assessment?
Thanks in advance for bringing my mind to the right path…
Best regards
Michael
- The topic ‘Unwanted add during add through an n:m relation’ is closed to new replies.