Problem/Motivation
The \Drupal\filebrowser\FileDisplayFile::createSubdir() method has an unused nested function called s3_create_subdir() that should be removed as it can cause issues if the method would be called more than once.
I did not find any use of this function, but if needed for any reason then it should be refactored properly.
Steps to reproduce
The following code
$file = new \Drupal\filebrowser\File\DisplayFile($nid);
$file->createSubdir('subdir1');
$file->createSubdir('subdir2');
will produce this error:
Fatal error: Cannot redeclare Drupal\filebrowser\File\s3_create_subdir() (previously declared in /app/web/modules/contrib/filebrowser/src/File/DisplayFile.php:144) in /app/web/modules/contrib/filebrowser/src/File/DisplayFile.php on line 144
Issue fork filebrowser-3585230
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:
- 3.1.x
changes, plain diff MR !15
- 3585230-remove-unused-nested
changes, plain diff MR !14
Comments
Comment #2
yce commentedComment #6
clivesj commentedYes, that is legacy code that should have been removed when the remote storage code was abstracted.
I will accept the MR shortly.
Thanks.
Comment #8
clivesj commented