1. piekielko
  2. RO CSVI
  3. Thursday, 12 March 2026
  4.  Subscribe via email
Hi RolandD,

Could you please consider adding the following code to the file
administrator/components/com_csvi/models/exports.php?

Since the latest version of the component, my custom PHP scripts for XML export have stopped working. The new class loading mechanism no longer detects custom exporters located in the com_csvi/helper/file/export/xml/ directory. Adding this small fallback loader allows custom exporters to be loaded correctly again without affecting the core functionality.

in line 2053

protected function loadExportFile(): void
{
$this->setExportFormat();

$exportsite = match ($this->exportFormat)
{
'xml', 'html' => $this->template->get('export_site', 'csvimproved'),
default => 'csvimproved',
};

$classname = '\\Rolandd\\Component\\Rocsvi\\Site\\File\\Export\\' . ucfirst($this->exportFormat) . '\\' . ucfirst($exportsite);

if (!class_exists($classname))
{
$customFile = JPATH_ADMINISTRATOR . '/components/com_csvi/helper/file/export/' . strtolower($this->exportFormat) . '/' . ucfirst($exportsite) . '.php';

if (is_file($customFile))
{
require_once $customFile;
}
}

if (!class_exists($classname))
{
throw new \RuntimeException('Export class not found: ' . $classname);
}

$this->exportClass = new $classname($this->template);
}


This restores compatibility with custom XML export scripts that worked in previous versions of CSVI.

Thank you for considering this improvement.

Kind regards
Chris
Accepted Answer Pending Moderation
Hi Chris,

The suggested change is not how I would like to see this implemented. Even with this code, it should fail unless your custom exported is also of the type FileExportInterface. Your custom exporter should also work if you move the file to the folder components/com_csvi/src/File/Export/Xml and change the filename and classname to match the site you have configured.

However I would like to see if we can come up with a more robust solution. By placing custom files within the component you may risk losing them or getting them overwritten and having to restore them. Having your custom exporter, you also probably changed the website dropdown with your own option(s), am I right?

We already have an override system in place for the import/export routines; the same system can be applied to the File exporters. The import/export routines are located in administrator/templates/admintemplate/html/com_csvi/component/model/export/override.php where some of the names in the path are variables. We can add support for administrator/templates/admintemplate/html/com_csvi/component/file/export/override.php. The code would get a list of files it finds there and add them to the website dropdown. For example, let's say a file is called chris.php. In the dropdown you would see Chris as an option and if selected, RO CSVI would look in the override export folder for a Chris.php file.

How does that sound?
Kind regards,

RolandD

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. 2 hours ago
  2. RO CSVI
  3. # 1
  • Page :
  • 1


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