The 'file_exists' configuration is not working as expected on Drupal 10.3.0 and above
The 'file_exists' configuration is not working as expected due to the fact that the FileSystemInterface::EXISTS_ERROR as well as
FileSystemInterface::EXISTS_RENAME and FileSystemInterface::EXISTS_REPLACE are deprecated from Drupal 10.3.0
In fact, if I set 'file_exists' to "use_existing", the file is still being replaced because the FileProcessBase plugin uses FileExists::Error instead of FileSystemInterface::EXISTS_ERROR. The same thing applies to "rename".
Steps to reproduce
1. Given a migration that uses the image_import plugin
2. Set the 'file_exists' configuration to 'use existing' as it is suggested in the documentation
3. Execute the migration
4. If if the file already exists it is always downloaded and replaced
This causes performance issues.
Proposed resolution
A proposed solution is to replace the deprecated constants with the newer way of working.
Remaining tasks
A patch to be submitted.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | deprecated-constants-3480302-2.patch | 2.31 KB | nikolabintev |
Issue fork migrate_file-3480302
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 #2
nikolabintev commentedPlease find the uploaded patches that solved the issue.
Comment #3
nikolabintev commentedComment #4
jsacksick commentedThe problem is, doing this means dropping support for Drupal core versions prior to 10.3... which is probably not desired...
See https://www.drupal.org/node/3426517.
Unless the maintainer's plan is to introduce a new major version?
Comment #5
nikolabintev commentedYes, this is what's need to be done. We need a new major version that supports Drupal 10.3 and 11
Comment #6
drclaw commentedI concur! Created a new 3.0.x branch and applied this patch. Changed core version requirements to ^10.3 || ^11.
🙏