Media Error Message

General questions relating to Joomla! 4.x.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting.
Forum Post Assistant - If you are serious about wanting help, you should use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10
Post Reply
cehbyrd
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Tue Feb 15, 2022 8:40 pm

Media Error Message

Post by cehbyrd » Tue Feb 15, 2022 9:10 pm

I'm completely new to Joomla and am using it for school. When I click on "Media" under "Content" under the admin page, I get the following error message: Property 'mime_type' of argument 'item' of event onFetchMediaItems has a wrong item. Valid: string"

I have no idea what this means. I uploaded Joomla onto our school's server and we are working from there.

If anyone has any suggestions, that would be great. I've already emailed the professor but he hasn't gotten back to me yet.

Thank you!

User avatar
sozzled
Joomla! Master
Joomla! Master
Posts: 12206
Joined: Sun Jul 05, 2009 3:30 am
Location: Canberra, Australia

Re: Media Error Message

Post by sozzled » Tue Feb 15, 2022 9:20 pm

Answered a short time ago: see viewtopic.php?f=811&t=991916
“If you think I’m wrong then say, ‘I think you’re wrong.’ If you say ‘You’re wrong!’, how do you know?”
Walking the talk: https://j4xdemo.enduring.com.au
:)

User avatar
ceford
Joomla! Guru
Joomla! Guru
Posts: 970
Joined: Mon Feb 24, 2014 10:38 pm
Location: Edinburgh, Scotland
Contact:

Re: Media Error Message

Post by ceford » Wed Feb 16, 2022 2:46 am

Pretty obscure, even for me. Seems the solution is to enabled fileinfo in php.ini although I have not confirmed that.

User avatar
toivo
Joomla! Master
Joomla! Master
Posts: 14773
Joined: Thu Feb 15, 2007 5:48 am
Location: Sydney, Australia

Re: Media Error Message

Post by toivo » Wed Feb 16, 2022 3:29 am

Obscure but the function getMimeType() in the file libraries/src/Helper/MediaHelper.php makes the logic perfectly clear.

First the function getMimeType() calls exif_imagetype(), if the exif module is configured in PHP. If it is not, the function calls getimagesize() from the GD extension, which also returns the MIME type.

If neither exif nor GD are included as PHP extensions, the function getMimeType() calls mime_content_type(), which is available if PHP has been compiled using the option --with-mime-magic.

Finally, as the last resort, the MIME type can be returned from the functions finfo_open() and finfo_file(), part of the the PHP extension Fileinfo. If Fileinfo is not enabled, Joomla returns an error.
Toivo Talikka, Global Moderator

User avatar
ceford
Joomla! Guru
Joomla! Guru
Posts: 970
Joined: Mon Feb 24, 2014 10:38 pm
Location: Edinburgh, Scotland
Contact:

Re: Media Error Message

Post by ceford » Wed Feb 16, 2022 3:50 am

Obscure but the function getMimeType() in the file libraries/src/Helper/MediaHelper.php makes the logic perfectly clear.
Excellent explanation. With that I would recommend a better PHP installation. All the ones I use come with the exif and the GD library already installed and enabled.


Post Reply

Return to “General Questions/New to Joomla! 4.x”