Problem/Motivation
When Filebrowser module is installed, it creates a filebrowser:// stream. This goes to 2 problems :
- In admin/config/media/file-system it automatically adds a new option to the default download method, this option has the same name as the public:// stream, say "Public local files served by the webserver.". This make confusion for the user who does'nt know what is the difference between these two options.
- The stream filebrowser:// point towards to [d8_installation_path]/modules/contrib/filebrowser, it's not a goog idea to put public files in a module directory, it can be erased after a module update.
- There's no way to modify the base path of this stream, see Drupal\filebrowser\FilebrowserStream::basePath
Proposed resolution
- In the actual state of the Filebrowser module, I think there is no use of this stream, so it can be deleted to avoid confusion.
Or
- Add a getName() and a getDescription() method to the Drupal\filebrowser\FilebrowserStream so the user can distinguish Public stream and Filebrowser stream in the UI.
- Modify the basePath method, instead of returning drupal_get_path("module", "filebrowser"), return the value of $settings['file_filebrowser_path'] = 'foo/bar/path'; in settings.php (or whatever config option), if this entry is not present, return the default public path "sites/default/files"
Comments
Comment #2
EnzoFr commentedComment #4
clivesj commentedI couldnt recall what it was used for but quickly realised when I deleted it. :)
Fixed now, Thanks
Comment #5
EnzoFr commentedOk, thank you clivesj. Do you know when this will be integrated to a stable release ?
Comment #6
clivesj commentedI am planning for a stable release around the 3th week of November
Comment #8
lpsolit commentedI don't know if this issue is responsible for filebrowser to no longer work with Drupal 8.8.0, but all directories are now empty, and the following warning is thrown:
Warning : Declaration of Drupal\filebrowser\FilebrowserStream\FilebrowserStream::basePath(?SplString $site_path = NULL) should be compatible with Drupal\Core\StreamWrapper\PublicStream::basePath($site_path = NULL) in require()
Could a new version of filebrowser be released asap so that it works again with Drupal 8.8.0, please?
Comment #9
clivesj commentedLpSoli..
Does it work on Drupal 8.7.x?
I do not see any change in core that would introduce a problem, but I m not in the position now to do a thorough investigation.
The change in this issue is not yet in stable FB 8.x-2.0 so this version should not be affected.
Comment #10
lpsolit commentedOK, it looks like I misconfigured something when importing a backup, which explains why my directories were all empty. My fault, sorry!
I applied your commit 405fb4b to my system, and now the warning mentioned in comment #8 is gone. Nice job!
Comment #11
jcisio commentedFYI it is due to a change in 8.8 https://www.drupal.org/project/drupal/issues/2234479#comment-13251583