Commit 3f1c3c01 authored by alexpott's avatar alexpott

Issue #2405337 by benjy: EntityFile destination doesn't handle temporary files...

Issue #2405337 by benjy: EntityFile destination doesn't handle temporary files when the source and destination are the same
parent 9243c13a
......@@ -50,6 +50,11 @@ public function import(Row $row, array $old_destination_id_values = array()) {
// already absolute.
$source = $this->isTempFile($destination) ? $file : $this->configuration['source_base_path'] . $file;
// If the start and end file is exactly the same, there is nothing to do.
if (drupal_realpath($source) === drupal_realpath($destination)) {
return parent::import($row, $old_destination_id_values);
}
$replace = FILE_EXISTS_REPLACE;
if (!empty($this->configuration['rename'])) {
$entity_id = $row->getDestinationProperty($this->getKey('id'));
......
......@@ -29,6 +29,9 @@ class MigrateFileTest extends MigrateDrupalTestBase {
* {@inheritdoc}
*/
protected function setUp() {
// Set the temp file of the site to the same as the D6 site, this allows us
// to test files which start and finish in the same place.
$this->tempFilesDirectory = '/tmp';
parent::setUp();
$dumps = array(
$this->getDumpDirectory() . '/Files.php',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment