DirectoryIterator::__construct(/web/vm2/mero//test/images/availability/): failed to open dir: No such file or directory
if the directory set up in VM's "General Assets URL" is wrong, it's not possible to visit the Virtuemart configuration backend on joomla 3.5.1 (and possibly other 3.x versions) because JHtml::_('list.images', 'image'.... returns non-recoverable user error if the path does not exists.
To fix this you may need to wrap this code into a try and catch clause:
\administrator\components\com_virtuemart\views\config\tmpl\default_shopfront.php
original code:
echo JHtml::_('list.images', 'image', VmConfig::get('rised_availability'), " ", $this->imagePath);
suggested code:
try
{
echo JHtml::_('list.images', 'image', VmConfig::get('rised_availability'), " ", $this->imagePath);
}
catch (Exception $e)
{
echo '';
}
best regards, stan
My current solution, directly in the layout
<?php if(!empty($this->imagePath)) {
echo JHtml::_('list.images', 'image', VmConfig::get('rised_availability'), " ", $this->imagePath);
} else {
echo vmText::_('COM_VIRTUEMART_ADMIN_CFG_ASSETS_GENERAL_PATH_MISSING');
}?>
Bug is real, but I tested DirectoryIterator in a search file (with many images), this is 2 to 3 time slower as:
opendir($path)))
while (($file = readdir ....
So perhaps changing code is better as fix it ?
We can do that later, when we use the VMF, but atm it is a joomla function as far as I understood.