Experiencing a 401 Unauthorized Error During Update?

If you're seeing a 401 Unauthorized error when trying to update your Joomla extension, it's likely due to our new two-factor authentication (2FA) security measure for your Download ID.
To resolve this, check your email (Spam folder?) for a message to approve your server or device, or read our detailed blog post here( onlinecommunityhub.nl/best-practice/new-...-extension-downloads) to understand the steps involved. This will guide you through approving your server for future updates.

Implemented Call to undefined method Joomla\Filesystem\File::getExt()

More
10 months 6 days ago #2829 by Helmut
This message contains secure information
The topic has been locked.
More
10 months 6 days ago #2830 by Ruud van Lent
Hi Helmut, that is strange as that method is a core joomla function. it is called always the same regardless of which directory you are using as input.
Are there files in the directory without extension?
What happens when you rename the directory and configure that to be displayed?
The topic has been locked.
More
10 months 5 days ago #2831 by Helmut
Hi Ruud,
yes - it's strange. I renamed the directory, but this doesn't work. I have a lot of directories with images (all of them with extension) and tested various - but none of them are working. I found out following:

In the file \plugins\system\ochglightbox\src\Helper\OchGlightboxHelper.php  (Line 31):
If i address the file-method in the old way, the images are shown without problem.
I changed: Joomla\Filesystem\File
To: use Joomla\CMS\Filesystem\File

Very strange
The topic has been locked.
More
10 months 5 days ago #2832 by Ruud van Lent
Hi Helmut,

the old one is deprecated in 4.4 and will be removed in 6.0. The documentation explicitly says to use the new one:
Code:
/**  * A File handling class  *  * @since  1.7.0  * @deprecated  4.4 will be removed in 6.0  *              Use Joomla\Filesystem\File instead.  */

But investigating learns that the replacement class doesn´t have the getExt() function, so replacing it as instructed can (and in your case will) lead to issues.

In the private message tab I have added a download link to a test version where I replace the getExt() function with a PHP equivalent (so not depending on Joomla class).
Can you test if this work correct on your site (it works on my site, but I can not reproduce the issue in the first place so would be nice to have confirmation that it works and that the error is gone.

regards,
Ruud.
The topic has been locked.
More
10 months 5 days ago - 10 months 5 days ago #2833 by Ruud van Lent
Also to follow up: this appears to be a J4.4 core issue. When doing a lookup for the getExt() function I get the following results for Joomla 5.0, 4.4 and 5.1:
Code:
./50/libraries/vendor/joomla/filesystem/src/File.php:    public static function getExt($file) ./50/libraries/src/Filesystem/File.php:    public static function getExt($file) ./44/libraries/src/Filesystem/File.php:    public static function getExt($file) ./51/libraries/vendor/joomla/filesystem/src/File.php:    public static function getExt($file) ./51/libraries/src/Filesystem/File.php:    public static function getExt($file)


as you can see the function is missing in 44/libraries/vendor/joomla/filesystem/src/File.php

I think the maintainers ran into this themselves and added it (back?) in 5.0 onwards, but 'forgot' to do this also in 4.4
Last edit: 10 months 5 days ago by Ruud van Lent.
The topic has been locked.
More
10 months 5 days ago #2834 by Helmut
Hello Ruud,
i read this too ( issues.joomla.org/tracker/joomla-cms/42460

Thanks for the dev-package - after installation all works fine!

Best regards
Helmut
The topic has been locked.
More
10 months 5 days ago #2835 by Ruud van Lent
Thanks for reporting back, and issue on github is indeed what is the case: IMO it should be backported so that what they advice to do actually works :)

Anyway, doing it this way also works.

Will release a new version somewhere in the next days, you can just upgrade over the test version without issues.

regards,
Ruud
The topic has been locked.