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

Class Joomla\CMS\Filesystem\File Not Found

jean luc trevilly

jean luc trevilly

SP Page Builder 1 day 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
3 Answers
jean luc trevilly
jean luc trevilly
Accepted Answer
1 day 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 day ago #230118

Hi Jean,

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

0
jean luc trevilly
jean luc trevilly
Accepted Answer
3 hours 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