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

Command icon 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

yce created an issue. See original summary.

yce’s picture

Issue summary: View changes

clivesj’s picture

Yes, that is legacy code that should have been removed when the remote storage code was abstracted.
I will accept the MR shortly.
Thanks.

  • clivesj committed 252a98f1 on 3.1.x authored by yce
    fix: #3585230 Remove unused nested s3_create_subdir function by: yce
    
clivesj’s picture

Status: Active » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.