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.

Comments

JSCSJSCS’s picture

I tried to add a second plugin to another source/target and got 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] => Subcategory [:db_insert_placeholder_3] => explode [:db_insert_placeholder_4] => a:3:{s:9:"separator";s:1:",";s:5:"limit";s:0:"";s:14:"real_separator";s:1:",";} [:db_insert_placeholder_5] => 0 [:db_insert_placeholder_6] => Explode ) in drupal_write_record() (line 6975 of /home/user/website.com/includes/common.inc).

So maybe it is something else?

JSCSJSCS’s picture

StatusFileSize
new71.53 KB

It looks like the feeds tamper database record is not getting a ID key, so any attempt to create another one is giving the error?

No ID field Key

JSCSJSCS’s picture

Status: Active » Fixed

I 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.

killtheliterate’s picture

Status: Fixed » Active

This 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.

PedroMiguel’s picture

Same here..

"Solved" by untar 1st the dev version and then overwrite the folder with beta3

summit’s picture

Yep, Beta-3 no problem, latest dev problem.
greetings, Martijn

madak’s picture

Same here.
When you add a plugin, "id" is always empty.

The problem is here.

function feeds_tamper_ui_add_plugin_form_validate($form, &$form_state) {
...
$form_state['values']['id'] = feeds_tamper_machine_name_callback($id, $form, $form_state); //this returns null.
....
} 
twistor’s picture

Version: 7.x-1.0-beta3 » 7.x-1.x-dev
Assigned: Unassigned » twistor
Status: Active » Needs review
StatusFileSize
new757 bytes

Hrm, don't know how that happened.

twistor’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.