Closed (fixed)
Project:
Migrate
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
30 Dec 2011 at 04:10 UTC
Updated:
24 Jan 2012 at 20:00 UTC
Found a bug in
MigrateDestinationTable::import()
The variable $primary_key is only filled in case of regular update, but not in case of Migration::DESTINATION.
Result: An integrity constraint violation.
Solution: One line to add.
<?php
if ($migration->getSystemOfRecord() == Migration::DESTINATION) {
foreach ($this->schema['primary key'] as $key) {
$primary_key[] = $key;
if (!isset($entity->{$key})) {
throw new MigrateException(t('System-of-record is DESTINATION, but no destination id provided'));
}
}
?>
Comments
Comment #1
mikeryanCommitted to D6 and D7, thanks!