Class Joomla\CMS\Filesystem\File Not Found - Question | JoomShaper

is live, now with multi-currency selling.

Class Joomla\CMS\Filesystem\File Not Found

jean luc trevilly

jean luc trevilly

SP Page Builder 1 month ago

On Joomla 6.1 with SP Page Builder Pro 6.7.0, saving any article triggers the error "Class Joomla\CMS\Filesystem\File not found," but only when a custom addon plugin is enabled (tested and confirmed: the error disappears if I disable the plugin and reappears if I re-enable it, regardless of the addon's actual content). This class was removed in Joomla 6.0 (having been deprecated since version 4.4; see Joomla API documentation). The SPPB code that scans or registers custom addons appears to still reference this obsolete class. Could you please check and correct this reference?

0
5 Answers
jean luc trevilly
jean luc trevilly
Accepted Answer
1 month ago #230115

The Joomla 6-compatible version of SP Page Builder 6.x still uses Joomla\CMS\Filesystem\File in components/com_sppagebuilder/builder/classes/base.php at line 263. Joomla 6 no longer provides this class. Replace File::exists() with is_file() or use a class compatible with Joomla 6.

0
Paul Frankowski
Paul Frankowski
Accepted Answer
Senior Staff 1 month ago #230118

Hi Jean,

Noted, I shared with the developer. Thanks for the code investigation.

0
jean luc trevilly
jean luc trevilly
Accepted Answer
1 month ago #230257

I found the exact cause. In components/com_sppagebuilder/builder/classes/base.php the file imports: use Joomla\CMS\Filesystem\File; use Joomla\Filesystem\Folder; On Joomla 6, Joomla\CMS\Filesystem\File is no longer available, while Joomla\Filesystem\Folder is already used in the same file. This causes every custom addon to fail during loadPluginsAddons() before admin.php is even loaded. The addon itself is not involved; the exception is thrown by SP Page Builder. It looks like File should use the same namespace as Folder, or the existence test should simply use is_file(). As a result, it is currently impossible to use custom addons on Joomla 6 following your official documentation without patching base.php.

In addition to the bug report, I would like to suggest updating the documentation for custom addon development. The current article: https://www.joomshaper.com/blog/how-to-create-custom-addon-in-sp-page-builder-4 is still the main reference for creating custom addons, but it targets SP Page Builder 4 and an older Joomla architecture. For developers working with Joomla 6 and SP Page Builder 6.x, it would be very helpful to have an official, up-to-date guide including: the recommended addon directory structure; the current PHP namespaces to use; asset loading recommendations; compatibility requirements for Joomla 6; a minimal "Hello World" addon compatible with SP Page Builder 6.x. This would avoid confusion and make custom addon development much easier.

Custom addons are one of the strengths of SP Page Builder. Having an official Joomla 6/SPPB 6 example would greatly help developers and reduce support requests.

Could you provide an official sample plugin for SP Page Builder 6.x on Joomla 6 that can be used as the reference implementation?

0
SC
Stuart Clark
Accepted Answer
1 month ago #230308

Good luck getting JoomShaper to take this seriously - they're very resistent to suggestions to make their products better!

0
jean luc trevilly
jean luc trevilly
Accepted Answer
1 month ago #230587

Hello,

I would like to follow up on this issue because it is now fully identified. The problem is not related to my custom addon. The crash occurs inside SP Page Builder itself: components/com_sppagebuilder/builder/classes/base.php The current code uses: use Joomla\CMS\Filesystem\File; ... if (File::exists($admin_file)) This class is no longer available in Joomla 6. Replacing: File::exists($admin_file) with: is_file($admin_file) solves the issue immediately and allows custom addons to load correctly ! This modification is safe because it only checks whether the addon admin.php file exists before loading it. It does not alter the addon structure or affect existing addons. However, this is only a temporary workaround on my website. Any future SP Page Builder update will overwrite this modified core file and the issue will return ! For this reason, I believe this small compatibility fix should be included in an official SP Page Builder release. Otherwise, developers following your official custom addon documentation cannot reliably use custom addons on Joomla 6 without manually modifying SP Page Builder core files. I would also suggest updating the custom addon documentation, as the current guide is based on SP Page Builder 4 and does not reflect the Joomla 6 / SP Page Builder 6 environment. Could you please confirm that this issue has been reported to the development team and that a permanent fix will be included in a future release?

Thank you.

0