I am getting the following error on install / uninstall of my custom component:

JFolder::files: Path is not a folder. Path: /var/www/joomla/administrator/components/com_mycomponent/sql/xml

Creating an empty xml folder quiets the error. There is nothing in my configuration xml file or anywhere else that I can see calling this folder, and no documentation anywhere I can find about why I'm getting this error. I'm hoping someone might point out what's causing it and save me digging through core code to figure it out.

What is the purpose of this folder? Is there something that's supposed to be in it?

EDIT: Here is a link to the component's XML configuration file, and one to the component's install script file.

  • 1
    Do you have a script.php file or something similar in the root of the zip that has a install method? It may derive from there – Lodder Mar 18 at 17:38
  • Yes, I do have a script.mycomponent.php file - I'm using the install() method to add component params and set a redirect, preflight() checking if it is an install or discover_install to make sure my component is a newer version than what's already installed, and postflight() to add some user groups and categories. Would any of those cause this behavior? – calligraphic-io Mar 18 at 18:08
  • Quite possibly. Could you add the code for that file and your XML file to your question please? – Lodder Mar 19 at 8:32
  • please edit your answer your to add main extension XML and script file code, so we can help you better by understanding your code. – Pratyush Mar 19 at 10:47
  • @Lodder I added links to the config and script file. The component is built on Akeeba's FOF30 library, and the installer extends that library's installer script. – calligraphic-io Mar 20 at 21:00

I think your problem is coming from the fact that FOF is using an additional Installer class for database and schemas:

FOF comes with the FOF30\Database\Installer class. Unlike Joomla!, it doesn't base its actions on unreliable version numbers. Instead, it will run SQL commands based on whether tables / fields exist, the reported type of fields or the result of custom SQL copublic function updateSchema()

Thus it is suggested to place (call) two additional functions - for example - in your installer script:

public function updateSchema()

And at uninstall:

public function removeSchema()

And you have to provide a schema XML file with your component:

The schema files are provided in XML format. You only need one XML file per database technology. By default these files are stored in the back-end of your component, under the sql/xml directory. This is something you can override through the $directory parameter you pass to the class constructor.

And the full description of the reasons and use of the above is here: https://github.com/akeeba/fof/wiki/The-XML-Database-Schema-Installer

You can see the usage of the above in one of the components from the author of FOF here: https://github.com/akeeba/akeebasubs/tree/development/component/backend/sql

I hope this gives some light on the subject for you.

  • That's exactly it, and I knew FOF had that feature but decided not to use it. Thanks for catching that for me! It really helps to feel confident about the framework (especially using FOF on top of Joomla!) and why it's doing things. – calligraphic-io Mar 26 at 22:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.