Problem/Motivation
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
Steps to reproduce
From the description
1. Use devel_generate
2. generate some content for something that has file attached
3. Don't set file_directory in settings.php
Proposed resolution
Suggested fix. Instead of $destination = $dirname . '/' . $random->name(10, TRUE) . '.txt';
this
if ($settings['file_directory']) {
$dirname .= '/';
}
$destination = $dirname . $random->name(10, TRUE) . '.txt';
Remaining tasks
Review
User interface changes
N/A
Introduced terminology
N/A
API changes
N/A
Data model changes
N/A
Release notes snippet
N/A