? Pending

User tests: Successful: Unsuccessful:

avatar pjdevries
pjdevries
2 Jun 2021

Pull Request for Issue #34358 .

Summary of Changes

Changed the way directory settings are obtained in the FileSystem - Local plugin. If mo directory has been explicitly chosen yet, return Media Manager's 'Path to 'Path to Files Folder' setting.

Testing Instructions

Make sure you have a fresh Joomla! 4.0 installation, or at least one with an unaltered FileSystem - Local plugin configuration.

Change both path's of the Media Manager configuration, i.e. 'Path to Files Folder' and 'Path to Images Folder'.

Open Media Manager.

Beware of caching when fiddling with the Media Manager and its path settings! (see also #34239)

Actual result BEFORE applying this Pull Request

The result depends on proper configuration of the FileSystem - Local plugin. If no directory is chosen, which is the default, the plugin returns [{"directory": "images"}] and the Media Manager shows nothing.

Expected result AFTER applying this Pull Request

A list of files in folder 'Path to Files Folder', if there are any, or an empty folder otherwise.

Documentation Changes Required

It's probably a good thing to document this somewhere, preventing (new) users to get confused.

avatar pjdevries pjdevries - open - 2 Jun 2021
avatar pjdevries pjdevries - change - 2 Jun 2021
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 2 Jun 2021
Category Front End Plugins
avatar pjdevries pjdevries - change - 2 Jun 2021
The description was changed
avatar pjdevries pjdevries - edited - 2 Jun 2021
avatar pjdevries pjdevries - change - 2 Jun 2021
Labels Added: ?
avatar Fedik
Fedik - comment - 2 Jun 2021

If mo directory has been explicitly chosen yet, return Media Manager's 'Path to 'Path to Files Folder' setting.

I am doubt here, the plugin should use own options. There may be another filesystem plugins.

If no directory is chosen, which is the default, the plugin returns [{"directory": "images"}] and the Media Manager shows nothing.

I not checked how it connected, but probably the folder should come from filesystem plugins only.

The path option in the new Media Manager configuration seems does not make sense anymore.

avatar pjdevries
pjdevries - comment - 2 Jun 2021

If mo directory has been explicitly chosen yet, return Media Manager's 'Path to 'Path to Files Folder' setting.

I am doubt here, the plugin should use own options. There may be another filesystem plugins.

If I understand it correctly:

  • The Local plugin supports local files.
  • The Media Manager also supports local files.

So I think it makes sense to use Media Manager's path setting as a default for the Local plugin,

If no directory is chosen, which is the default, the plugin returns [{"directory": "images"}] and the Media Manager shows nothing.

I not checked how it connected, but probably the folder should come from filesystem plugins only.

I did check. After changing paths in the Media Manager, it did not work anymore until I selected the proper directory in the Local plugin.

The path option in the new Media Manager configuration seems does not make sense anymore.

That may well be, but it is there and can be used. As long as that's the case, I think it must behave in a predictable manner.

avatar Fedik
Fedik - comment - 2 Jun 2021

If I understand it correctly:
The Local plugin supports local files.
The Media Manager also supports local files.

The thing that Media Manager supports depend from enabled FileSystem plugins.
On its own it does not support anything.

avatar richard67
richard67 - comment - 2 Jun 2021

I agree with @Fedik . You can install a filesystem plugin e.g. for using Dropbox, and then you can set paths to files and images folders in the media manager options. With the change which is suggested here, the local filesystem plug-in would use the path to a folder on Dropbox as directory, and that would be wrong.

avatar pjdevries
pjdevries - comment - 2 Jun 2021

@Fedik @richard67 I'm not sure I understand. Is it possible to have multiple active filesystem plugins? If so, how does the Media Manager distinguish between them, i.e. know which one to use?

avatar richard67
richard67 - comment - 2 Jun 2021

@pjdevries Yes, the media manager can use multiple different filesystems. Each one is a base folder in the media manager. See the testing instructions in this PR: #33724 . In media manager you see 2 parent folders where you can navigate to children, the local "Images" and the "Dropbox" folder when doing as described in that PR.

avatar richard67
richard67 - comment - 2 Jun 2021

P.S.: Same when e.g. inserting an image into an article: You can use images from the local filesystem as well as from Dropbox when using that dropbox plugin (which is not ready yet and was developed just for testing, but I'm sure sooner or later you will find more such plugins in the extensions directoy).

avatar Fedik
Fedik - comment - 3 Jun 2021

I think we need to consider removing file_path and image_path from Media config.
I do not see a reason why we need them, but I may be wrong.

avatar pjdevries
pjdevries - comment - 3 Jun 2021

I think we need to consider removing file_path and image_path from Media config.
I do not see a reason why we need them, but I may be wrong.

From what I understand from @richard67's explanation, I think you are right. If Media Manager no longer uses those paths but only the adapter settings, the issue that resulted in this PR vanishes automatically. A default return value of 'images' from the Local filesystem plugin, also makes sense then, making this PR unnecessary and @brianteeman a happy dude :)

avatar pjdevries
pjdevries - comment - 3 Jun 2021

@richard67

See the testing instructions in this PR: #33724

Seemed like a good idea to play a bit with multiple adapters, but I get this known error: 'Call to undefined method GuzzleHttp\Utils::chooseHandler()'.

avatar richard67
richard67 - comment - 3 Jun 2021

Seemed like a good idea to play a bit with multiple adapters, but I get this known error: 'Call to undefined method GuzzleHttp\Utils::chooseHandler()'.

@pjdevries That's an issue with that plugin which was a quick made thing just for testing. You can find the solution here: #33724 (comment)

avatar pjdevries
pjdevries - comment - 3 Jun 2021

That's an issue with that plugin which was a quick made thing just for testing. You can find the solution here: #33724 (comment)

Yes, works! Cool!

avatar chmst chmst - change - 31 Jan 2022
Labels Added: ?
Removed: ?

Add a Comment

Login with GitHub to post a comment