Commit 84214e86 authored by alexpott's avatar alexpott

Issue #2615450 by webflo: Fix random test failure caused by EntityFile::processStubRow

parent 7bef4e6d
......@@ -7,6 +7,7 @@
namespace Drupal\file\Plugin\migrate\destination;
use Drupal\Component\Utility\Unicode;
use Drupal\Core\Entity\EntityManagerInterface;
use Drupal\Core\Entity\EntityStorageInterface;
use Drupal\Core\Field\FieldTypePluginManagerInterface;
......@@ -289,6 +290,7 @@ protected function processStubRow(Row $row) {
// Make it into a proper public file uri, stripping off the existing
// scheme if present.
$value = 'public://' . preg_replace('|^[a-z]+://|i', '', $value);
$value = Unicode::substr($value, 0, $field_definitions['uri']->getSetting('max_length'));
// Create a real file, so File::preSave() can do filesize() on it.
$row->setDestinationProperty('uri', $value);
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