In migrate/plugins/destinations/poll.inc at public function complete()
To avoid duplication messages related to primary keys in the table poll_vote I changed
db_insert('poll_vote')
->fields(array(
'chid' => $chid,
'nid' => $entity->nid,
'uid' => $vote['uid'],
'hostname' => $vote['hostname'],
'timestamp' => $vote['timestamp'],
))
->execute();
Into
$migration = Migration::currentMigration();
try {
db_insert('poll_vote')
->fields(array(
'chid' => $chid,
'nid' => $entity->nid,
'uid' => $vote['uid'],
'hostname' => $vote['hostname'],
'timestamp' => $vote['timestamp'],
))
->execute();
} catch (Exception $e) {
// If we catch any errors here, save the messages.
$migration->saveMessage($e->getMessage());
}
Comments
Comment #1
brice_gato commentedComment #2
brice_gato commentedComment #3
brice_gato commentedComment #4
mikeryanPlease submit a patch. Also, please use saveMessage() (see exception handlers in other destination plugins for examples) rather than drupal_set_message().
Comment #5
brice_gato commentedComment #6
brice_gato commentedHere is a patch ...
Comment #7
brice_gato commentedComment #9
brice_gato commentedHere is the correct patch ...
Comment #10
brice_gato commentedComment #12
pifagor commented