I have a taxonomy which I associate with events on my site, to categorise the events. Events can fall into multiple categories at once, e.g. both a performance and some floor spots. If I associate a gmap marker with each taxonomy term I get a constraint violation whenever an event has two items from the vocabulary associated with it, e.g.
PDOException: SQLSTATE[23000]: Integrity constraint violation:
1062 Duplicate entry '6469' for key 'PRIMARY': INSERT INTO
{gmap_taxonomy_node} (nid, tid, marker) VALUES (:db_insert_placeholder_0,
:db_insert_placeholder_1, :db_insert_placeholder_2); Array (
[:db_insert_placeholder_0] => 6469 [:db_insert_placeholder_1] => 43
[:db_insert_placeholder_2] => small red ) in gmap_taxonomy_node_update()
(line 183 of /sites/all/modules/gmap/gmap_taxonomy.module).
Looking at line 183 I can see that the code is trying to add all the terms to the database, but as 'nid' is marked as the primary key in the table it then produces this error.
I can see that there are potential issues with having more than one marker associated with a node - i.e. which one should be displayed on the map - however I think it would be a useful feature, with some sort of fallback marker for the nodes with more than one marker.
As it stands the module seems to be in an intermediate state whereby part of it would allow it, but the database structure disallows it, with the result that there is an obscure error message. The error message at least could be sorted out by the code catching this before it is sent to the database.
Comments
Comment #1
lindsay.wils commentedIm also facing this same issue and would like some kind of fall back, but im not wanting to update contrib code, so hopefully a fix is posted by someone.
Comment #2
FuXXz commentedAny solutions?
Comment #3
anybodyPlease put your power in here: #2043673: DB error when adding nodes with multiple marker-enabled tags