Joomla-cms: [4.0] [Mediamanager] Error when no filesystem plugin is installed/enabled

Created on 8 Jun 2017  Â·  30Comments  Â·  Source: joomla/joomla-cms

Steps to reproduce the issue

Disable the "Filesystem - Local" plugin and try to create a folder in the Media Manager

Expected result

An error message.
Best would probably be no button and a big error message that at least one plugin of the type "filesystem" has to be enabled.

Actual result

Trying to create a folder gives a JS error in the console, but otherwise no feedback.
mediamanager.js:8741 Uncaught TypeError: Cannot read property 'type' of undefined at Api._normalizeItem (mediamanager.js:8741) at Object.<anonymous> (mediamanager.js:8664) at i (jquery.min.js?ef4f4ab…:2) at Object.fireWith [as resolveWith] (jquery.min.js?ef4f4ab…:2) at A (jquery.min.js?ef4f4ab…:4) at XMLHttpRequest.<anonymous> (jquery.min.js?ef4f4ab…:4)

Additional comments

This was detected by @brianteeman in https://github.com/joomla/joomla-cms/pull/16561#issuecomment-307070696, I openend a new issue for it.

On a sidenote it wasn't quite clear to me what that "Filesystem - Local" plugin does. Maybe the group can be renamed to media-filesystem similar to the media-action group. So it is clear it relates to the Media Manager.

J4 Media Manager No Code Attached Yet

Most helpful comment

We should at least handle this case in the Media Manager itself and display a warning when no filesystem plugin is installed or enabled. I will create an issue for that in the nmm repo

All 30 comments

@Bakual quite similar to authentications plugins at least one filesystem adapter must be enabled at all times:

screen shot 2017-06-08 at 19 19 47

I guess we can throw an alert and not load the media manager.js if someone mess up badly the system

I guess we can throw an alert and not load the media manager.js if someone mess up badly the system

:+1:

as stated in the other thread - the plugin is enabled on my system and it is still broken

@brianteeman what OS, browser?

any browser. windows 10

When we want to continue with plugins than we need a way to make certain that some plugins can't be disabled / uninstalled etc.

@andrepereiradasilva you made a pull request for that some time ago. Are you interested on following up on this?

as stated in the other thread - the plugin is enabled on my system and it is still broken

That's strange. What happens if you open and save the "Filesystem - Local" plugin? Or disable/enable it? And maybe try running the database fixer?
My tests were done on my existing site and I discovered the plugins.

When we want to continue with plugins than we need a way to make certain that some plugins can't be disabled / uninstalled etc.

Disabling is fine. Uninstalling would be fine as well, you would mess with your system the same way you do when you uninstall other core plugins. Given you have at least one other plugin it will work as expected.

quite similar to authentications plugins at least one filesystem adapter must be enabled at all times:

Similar but not the same bad outcome. If you have no filesystem plugin enabled, the media manager becomes useless. But that's all and it is easy to fix again. However if you disable all authentication plugins, good luck with fixing that as you can't log in anymore 😄

I didnt need to discover as it was a clean install

I tried the enable/disaable trick - nothing

Nothing to fix
Database schema version (in #__schemas): 4.0.0-2017-05-31.

... and that is one of the reasons the PR (https://github.com/joomla/joomla-cms/pull/13037) was created, ie, to allow for extensions to be protected from disabling, and/or locked from uninstalling.

... and that is one of the reasons the PR (#13037) was created, ie, to allow for extensions to be protected from disabling, and/or locked from uninstalling.

Only that it would be absolutely fine to disable that specific plugin, if you have another one. Eg a dropbox integration plugin 😄

@brianteeman I'm lost then. I just tried a clean install based on current 4.0-dev on Chrome/WIndows10 and had no issues.

i tried again with a completely fresh download and install in a completely new folder
no luck at all - exactly the same behaviour

@brianteeman is your test site on a subfolder? If so can you give us the relative path to the root of the server?

I did but I also tested it in the root

Do you have the same error or a different one?

We should at least handle this case in the Media Manager itself and display a warning when no filesystem plugin is installed or enabled. I will create an issue for that in the nmm repo

Errors are the same

After recovering from the overnight shock I will retest

I installed it on a linux server now and it worked fine - still wont work on my local server though

@brianteeman Are you using XAMPP for your local server? Because that one works fine on my Windows 10. Just trying to figure out the difference in the setup.

No it is a custom build based on Niks blog post - systeminfo attached

systeminfo-2017-06-09T13-58-52+00-00.txt

@brianteeman can you login as admin, open /administrator/index.php?option=com_media&format=json&task=api.files&path=/ and post the response of that request?

{"error":true,"code":0,"message":"Call to undefined function mime_content_type()"}

OK so I have it working now. @dneukirchen post pointed me in the correct place inside php and I had to enable php_fileinfo.dll DLL file in php.ini

https://stackoverflow.com/questions/14809054/mime-content-type-function-not-working

So as I expected it is a server configuration issue that we must detect and provide a sensible error message. We also need to update the system requirements to indicate that this needs to be enabled AND to test for it

Made a pr which should handle your situation carefully https://github.com/joomla-projects/media-manager-improvement/pull/248 and will not crash when that function doesn't exist.

Sorry I was confusing this with the requirement to have php_fileinfo.dll enabled

Set to "closed" on behalf of @franz-wohlkoenig by The JTracker Application at issues.joomla.org/joomla-cms/16586

@Bakual: according to @laoneo closing this Issue, please open a new one at https://github.com/joomla-projects/media-manager-improvement.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/16586.

There is no need to open another one as we fixed it already.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

PhilETaylor picture PhilETaylor  Â·  3Comments

Hils picture Hils  Â·  5Comments

dougbevan picture dougbevan  Â·  4Comments

uglyeoin picture uglyeoin  Â·  5Comments

mbabker picture mbabker  Â·  4Comments