FileSystemInterface::EXISTS_ERROR is deprecated in 10.3.0

Created on 12 October 2024, 6 months ago

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.

🐛 Bug report
Status

Needs work

Version

2.0

Component

Code

Created by

🇧🇬Bulgaria nikolabintev

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024