- Issue created by @matslats
I'm using devel_generate to generate nodes which have file attachments.
Drupal\file\Plugin\Field\FieldType\FileItem::generateSampleValue()
generates uris with 3 slashes when files are not configured to be in a subdirectory. so if $settings['file_directory'] is configured it's great
private://my_dir/blah.txt
otherwise
private:///blah.txt
Suggested fix. Instead of
$destination = $dirname . '/' . $random->name(10, TRUE) . '.txt';
this
if ($settings['file_directory']) {
$dirname .= '/';
}
$destination = $dirname . $random->name(10, TRUE) . '.txt';
Active
10.3 ✨