User tests: Successful: Unsuccessful:
Pull Request for Issue #32288 .
Corrects the URL for media manager
Status | New | ⇒ | Pending |
Category | ⇒ | JavaScript Repository NPM Change |
Labels |
Added:
NPM Resource Changed
?
|
Category | JavaScript Repository NPM Change | ⇒ | JavaScript Administration com_media NPM Change Repository |
Along my tests on that test site I had added 2 files in the images folder
file_example.mp4
login.svg
Deleting these solves my issue. No more GET
remains to find why...
Deleting these solves my issue. No more GET
Does this happen only on multilingual or on normal sites as well?
Does this happen only on multilingual or on normal sites as well?
testing now. give me a sec
The media manager is missing a lot of file types:
Updating:
mp4,svg,bmp,csv,doc,gif,ico,jpg,jpeg,odg,odp,ods,odt,pdf,png,ppt,txt,xcf,xls,BMP,CSV,DOC,GIF,ICO,JPG,JPEG,ODG,ODP,ODS,ODT,PDF,PNG,PPT,TXT,XCF,XLS
svg,bmp,gif,jpg,png
video/mp4,image/svg+xml,image/jpeg,image/gif,image/png,image/bmp,application/msword,application/excel,application/pdf,application/powerpoint,text/plain,application/x-zip
@infograf768 for starters this
is not the best way to get the extension, there's a PHP native method for this https://www.php.net/manual/en/function.pathinfo.phpAlso can you var_dump($e)
or get a breakpoint here:
Sorry, I still can't replicate it
The path is correctly obtained. Tested by deleting the svg.
I have no problem editing the usual files (jpg, etc.) with this PR or without it.
var_dump($e);
gives nothing.
and same for mp4 I guess.
mp4 works fine, it display "file-icon".
btw, you should not add mp4 to legal images, because it not an image
this may be a reason if you have this bug with mp4
yes, it because mp4 not an image.
I think the code need to be smarter, and do not crash even if user add doc,xls,pdf as "legal images". Enough to show a "file icon" or another random icon.
@infograf768 @Fedik I guess someone needs to do the remain tasks from #31233
See my comment there #31233 (comment)
hmm
we have a specific video vue
administrator/components/com_media/resources/scripts/components/browser/items/video.vue
and mp4 is all over the place in constants
/Applications/MAMP/htdocs/newfolder/joomla40/administrator/components/com_media/resources/scripts/components/browser/items/item.es6.js:21: const videoExtensions = ['mp4'];
/Applications/MAMP/htdocs/newfolder/joomla40/administrator/components/com_media/resources/scripts/components/browser/items/item.js:20: let videoExtensions = ['mp4'];
/Applications/MAMP/htdocs/newfolder/joomla40/administrator/components/com_media/resources/scripts/components/browser/items/row.vue:73: const extensionWithPreview = ['jpg', 'jpeg', 'png', 'gif', 'mp4'];
/Applications/MAMP/htdocs/newfolder/joomla40/libraries/vendor/guzzlehttp/psr7/src/MimeType.php:81: 'mp4' => 'video/mp4',
and mp4 is all over the place in constants
The guzzlehttp
is a composer dependency so this is something the project can't directly change. Also I have no clue if this is even used here
About the administrator/components/com_media/resources/scripts/components/browser/items/video.vue
file this was exactly what I was referring in #31233 (comment) The hard coded parts there are really bad
EDIT: One more thing here, the local adapter, as far as I understand the code, is only returning info for images:
joomla-cms/plugins/filesystem/local/src/Adapter/LocalAdapter.php
Lines 325 to 372 in f856578
This can't be right
There need to hardcode "previewable" file types, it should not depend from User config.
So User can enter anything in to "Images", and system only do preview only for "previewable".
So User can enter anything in to "Images", and system only do preview only for "reviewable".
I'm not sure that I agree here. Eg I'm the admin and I disable .webp
I would expect the system to respect my choice and use the placeholder icon for any .webp
image
So User can enter anything in to "Images", and system only do preview only for "reviewable".
I'm not sure that I agree here. Eg I'm the admin and I disable
.webp
I would expect the system to respect my choice and use the placeholder icon for any.webp
image
So it needs to check both arrays, the allowed images and the previewable images, and only if it is in both it shall be previewed.
Or check the intersect of the 2 arrays only one time.
Or check the intersect of the 2 arrays only one time.
I'll go for this one
Who of you two will make the PR?
I'm not sure that I agree here. Eg I'm the admin and I disable .webp I would expect the system to respect my choice and use the placeholder icon for any .webp image
You cannot show more than browser able to show.
Add .webp and .avif to list of previewable, but they need an extra care in non supported browsers,
Or check the intersect of the 2 arrays only one time.
It does not make sense, again you cannot show more than browser able to show.
It does not make sense, again you cannot show more than browser able to show.
@Fedik it's not about the browser's capabilities, it's about respecting the admin's options. If for whatever reason they don't want to support .gif
files these files should not appear in the media manager
it's about respecting the admin's options
I am not talking about what is diplaied in the Media browser, admin can show any
I am about render the preview.
If Admin choose to show png,jpg,webp,pdf,foobar
then in Media browser should be visible ALL this files, but render preview only for previewable png,jpg,webp
, rest should stay as Icon.
I am about render the preview.
If Admin choose to showpng,jpg,webp,pdf,foobar
then in Media browser should be visible ALL this files, but render preview only for previewablepng,jpg,webp
, rest should stay as Icon.
@Fedik Then I think we want the same thing, we have just chosen different words to describe it
we have just chosen different words to describe it
Can be
Here is pseudo code:
loop Image in Images:
if can preview Image:
show preview
else:
show icon
Here is pseudo code:
Well, in that case, we need to pass from PHP a list with all the files that can have a preview. The allowed list should be used only to upload/manipulate/select a file. A simple JSON file with all the valid extensions for all file types could be passed with addScriptOptions so we don;t have to hard code things...
loop Image in Images: if can preview Image: show preview else: show icon
Maybe we can do a
> if can preview Image:
> show preview
> else if image shows a cat:
> show preview in any case because it's soo cute
> else:
> show icon
show preview in any case because it's soo cute
This is debatable. Dog people might suggest their favourite pet
I'm closing this as it's obviously not solving the problem here
Status | Pending | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2021-02-14 10:05:47 |
Closed_By | ⇒ | dgrammatiko |
Maybe open an umbrella issue for all media manager issues (eg https://github.com/joomla/joomla-cms/projects)
There is one, but it's closed: https://github.com/joomla/joomla-cms/projects/9 ;-)
Anyway, creating projects is beyond my privileges. Will check what to do.
Hello, sorry for this intervention. But the Joomshaper team had already found problems in the media manager (from memory). They had for that, realized a new media manager. Maybe we need to get closer to them to save time? It's a simple proposition.
https://youtu.be/Ks8tuxrmv24
Not on me to decide such things.
@Magnytu2 the repo is still there: https://github.com/joomla-projects/j4adminui so someone (not me) could diff and merge things
@dgrammatiko There was another version, much easier to install. I am a fan of Joomla! and yet it is bigger mistake than I regret. Since the time everything would already be corrected.
@dgrammatiko
Sorry, but this does not help.
I still get
GET http://localhost:8888/newfolder/joomla40/fr/administrator/undefined