Problem/Motivation
The docblock for Drupal\file\FileRepositoryInterface::writeData() has this line:
Writes a file to the specified destination and creates a file entity.
However, the implementation in Drupal\file\FileRepository::writeData() calls Drupal\file\FileRepository::createOrUpdate(), where if there is an existing file entity matching the URI where the file data is saved on disk, the file is loaded and saved, and no new file entity is created.
The documentation then is misleading.
Steps to reproduce
Proposed resolution
Update the docblock in Drupal\file\FileRepositoryInterface::writeData() to indicate it will either update a matching file entity or create a new file entity.
Remaining tasks
User interface changes
Introduced terminology
API changes
Data model changes
Release notes snippet
Issue fork drupal-3511456
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
arunsahijpal commentedWorking on it.
Comment #5
arunsahijpal commentedHi @godotislate,
I've updated the docblock, pls check.
Comment #6
godotislatelgtm
Comment #7
godotislate@arusahijpal Can you re-run the failing jobs in the pipeline? They should be unrelated, but it's better to make sure the tests are all green.
Comment #8
arunsahijpal commented@godotislate,
I ran the pipeline again but it is still failing.
Comment #11
catchThe pipeline wasn't happy, although there shouldn't be any reason the docs would affect anything, but just for paranoia's sake I tried to re-run it again, got a vendor directory not found error, so rebase the branch, and that pipeline passed after a couple of random failures.
Committed/pushed to 11.x, thanks!
Comment #15
catch