If I add a feed tamper to a field in the feeds importer (I am using Commerce Product processor), then delete the source field in the mapping associated with the tamper (because i misspelled the source name, etc.), then when I try to apply a new feeds tamper to a newly created source mapping field, it will generate this error:
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '' for key 'PRIMARY': INSERT INTO {feeds_tamper} (id, importer, source, plugin_id, settings, weight, description) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6); Array ( [:db_insert_placeholder_0] => [:db_insert_placeholder_1] => raritan_pdu_importer [:db_insert_placeholder_2] => Price [:db_insert_placeholder_3] => math [:db_insert_placeholder_4] => a:2:{s:9:"operation";s:14:"multiplication";s:5:"value";s:3:"100";} [:db_insert_placeholder_5] => 0 [:db_insert_placeholder_6] => Multiply by 100 to get cents ) in drupal_write_record() (line 6975 of /home/user/website.com/includes/common.inc).
I have to use PHPmyAdmin and delete the tamper record in order to get past the error and be able to add the tamper to the new source field.
Steps to reproduce:
1) Map a source to a target. Click Save. (I used the misspelled Source name PrIce)
2) Click Configure Feeds Tamper
3) Click +add plugin.
4) Select Mathematical Operation, Operation *, Value 100, Click Add
5) Return to mapping, click save
6) Select Remove check box next to recently tampered source, click Save
7) Recreate the Source/target mapping (with correct spelling Price), Click Add, then Save
8) Click Configure Feeds Tamper
9) Click +add plugin.
10) Select Mathematical Operation, Operation *, Value 100, Click Add
11) See above error generated
I think if a source/target is deleted, any associated feed tampers should also be deleted from the database so this error does not occur.
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | feeds_tamper-integrity-constant-violation-1436320-8.patch | 757 bytes | twistor |
| #2 | no_id_key.png | 71.53 KB | JSCSJSCS |
Comments
Comment #1
JSCSJSCS commentedI tried to add a second plugin to another source/target and got this error:
So maybe it is something else?
Comment #2
JSCSJSCS commentedIt looks like the feeds tamper database record is not getting a ID key, so any attempt to create another one is giving the error?
Comment #3
JSCSJSCS commentedI completely uninstalled the feeds_tamper 7.x-1.0-beta3-18 that drush automatically DL'd when I first installed the module and installed the latest beta3. I noticed right away that the math.inc file was missing. So I got the one from the dev version and put it in its place. This combination fixed my issue for now.
Comment #4
killtheliterate commentedThis is still occuring. Tamper plugins are not getting assigned an ID, which, if you have more than one tamper plugin enabled, results in the above error.
Confirming that a bunch of includes are missing from the lastest 7 stable release.
Comment #5
PedroMiguel commentedSame here..
"Solved" by untar 1st the dev version and then overwrite the folder with beta3
Comment #6
summit commentedYep, Beta-3 no problem, latest dev problem.
greetings, Martijn
Comment #7
madak commentedSame here.
When you add a plugin, "id" is always empty.
The problem is here.
Comment #8
twistor commentedHrm, don't know how that happened.
Comment #9
twistor commentedCommitted.
http://drupalcode.org/project/feeds_tamper.git/commit/8f7f581