1. piekielko
  2. RO CSVI
  3. Tuesday, 12 May 2026
  4.  Subscribe via email
Call to undefined method Joomla\Filesystem\Folder::exists()

There is a bug in the Rocsvi.php file

foreach ($namespaces as $suffix => $path) {
if (Folder::exists($path)) {
\JLoader::registerNamespace('\\Rolandd\\Component\\Rocsvi\\' . $suffix, $path);
}
}

should be

foreach ($namespaces as $suffix => $path) {
if (is_dir($path)) {
\JLoader::registerNamespace('\\Rolandd\\Component\\Rocsvi\\' . $suffix, $path);
}
}


best regards,
Chris
Accepted Answer Pending Moderation
Hi Chris,

Out of the few hundred installations, so far 2 people have had this issue. You and someone else. So far I have been unable to reproduce it. Your solution works of course because you are no longer using the Joomla library.

However the initial call uses \Joomla\Filesystem\Folder which is available since Joomla 5. So I don't understand why the class is not loaded in your case. Would you mind to run a test for me?

Keep the file as it is orignally and add this code after line 49. This is the fix included for the next release.

JLoader::registerAlias('\\Joomla\\CMS\\Filesystem\\Folder', '\\Joomla\\Filesystem\\Folder', '6.0');
Let me know how it goes.
Kind regards,

RolandD

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. 5 hours ago
  2. RO CSVI
  3. # 1
Accepted Answer Pending Moderation
Hi Roland,

Yes, your fix partially resolves the problem, but not completely. :)
The main issue is that:

use Joomla\Filesystem\Folder;

needs to be changed to:

use Joomla\CMS\Filesystem\Folder;

After changing the namespace, everything works correctly and Folder::exists() works without issues.


but this solution will only work with Joomla 5, and I suspect it won't work with Joomla 6. That's why I think the best option is to simply use `is_dir($path)` :)


Best regards,
Chris
  1. 5 hours ago
  2. RO CSVI
  3. # 2
Accepted Answer Pending Moderation
Hi Chris,

That change is the one I want to avoid :D That is because it doesn't work in Joomla 6 as Joomla 6 no longer has the namespace Joomla\CMS\Filesystem. Now I also realize why my fix is no good. I am referencing the new namespace but that is not found in the first place.

Thank you for the test. I will completely remove the Joomla namespace and use the is_dir. I still find it odd why the new namespace is not loaded on some sites.
Kind regards,

RolandD

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. 5 hours ago
  2. RO CSVI
  3. # 3
Accepted Answer Pending Moderation
This situation reminds me a bit of JavaScript and jQuery years ago. At first, everyone moved to jQuery because it solved many problems and simplified development. But today, modern browsers support native JavaScript so well that many developers are moving back to plain JS again.

Modern PHP already has safe and reliable native functions like is_dir(), but Joomla still adds heavy abstraction layers around very simple operations :D
  1. 5 hours ago
  2. RO CSVI
  3. # 4
Accepted Answer Pending Moderation
You are right. The question is when to use a library or something native or even roll your own. The Folder/File classes stem from the days that a lot of people still used FTP to upload and access their sites. FTP and permissions were a nightmare.

But today, modern browsers support native JavaScript so well that many developers are moving back to plain JS again.
We are doing the same actually, removing jQuery dependencies.
Kind regards,

RolandD

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. 4 hours ago
  2. RO CSVI
  3. # 5
Accepted Answer Pending Moderation
I honestly think the Joomla developers have pushed themselves a bit too far into a corner with all these constant architectural changes in the CMS. Many extension developers are basically hitting their heads against the wall trying to constantly adapt to new APIs, namespaces, and internal rewrites.

The funny thing is that there is now always the option to go back to the proven Joomla 3, which was recently revived by the guys from JoomlaWorks. And it already works perfectly fine with the latest PHP and MySQL versions :D

https://github.com/joomlaworks/joomla-3.x
  1. 4 hours ago
  2. RO CSVI
  3. # 6
Accepted Answer Pending Moderation
Hey Roland,

I’ve got good news for you — you don’t need to change anything in your file.

I finally figured out why this error appears and why so few people reported the issue. The problem only occurs on Joomla! 5.3.x.

Out of curiosity, I installed the exact same component on Joomla! 5.4.5 and everything works perfectly without any errors.

So it looks like this is more related to differences between the older Joomla! 5.3.x branch and the newer 5.4.5 version, rather than an issue with your component itself.

Of course, for older Joomla versions, it’s still worth using this fix as a workaround.

To be fair, our solution is probably even better anyway, because it simply works consistently regardless of the Joomla version. ?
  1. 2 hours ago
  2. RO CSVI
  3. # 7
  • Page :
  • 1


There are no replies made for this post yet.
Be one of the first to reply to this post!