• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Fixed cannot save in admin options

jgas

Active member
#1
Ho. I have no mods installed.
When i try to save on performance options i get this error and the options are not saved :

What can i do? Thanks
Invalid argument supplied for foreach()
* *XenForo_Application::handlePhpError()* in *XenForo/Template/FileHandler.php* at line *119*
* *XenForo_Template_FileHandler->_deleteTemplate()* in *XenForo/Template/FileHandler.php* at line *67*
* *XenForo_Template_FileHandler::delete()* in *XenForo/Model/Template.php* at line *1424*
* *XenForo_Model_Template->deleteTemplateFiles()* in *XenForo/Option/TemplateFiles.php* at line *27*
* *XenForo_Option_TemplateFiles::verifyOption()*
* *call_user_func_array()* in *XenForo/DataWriter/Option.php* at line *345*
* *XenForo_DataWriter_Option->_validateOptionValuePreSave()* in *XenForo/DataWriter/Option.php* at line *211*
* *XenForo_DataWriter_Option->_preSave()* in *XenForo/DataWriter.php* at line *1414*
* *XenForo_DataWriter->preSave()* in *XenForo/DataWriter.php* at line *1354*
* *XenForo_DataWriter->save()* in *XenForo/Model/Option.php* at line *568*
* *XenForo_Model_Option->updateOptions()* in *XenForo/ControllerAdmin/Option.php* at line *174*
* *XenForo_ControllerAdmin_Option->actionSave()* in *XenForo/FrontController.php* at line *310*
* *XenForo_FrontController->dispatch()* in *XenForo/FrontController.php* at line *132*
* *XenForo_FrontController->run()* in */var/www/vhosts/musicadigitale.net/httpdocs/xenforo/admin.php* at line *13*
 

Robbo

Well-known member
#2
A temp fix (not one that fixes the underlying problem, that's what Kier and Mike are for) would be to replace this...

Line 119.
PHP:
foreach (glob($wildcard) AS $file)
{
    @unlink($file);
}
With this
PHP:
if (($files = glob($wildcard) !== false))
{
    foreach ($files AS $file)
    {
        @unlink($file);
    }
}
 

Kier

XenForo Developer
Staff member
#3
This is what I've put in:
PHP:
foreach ($languageId AS $_languageId)
{
    $files = glob($this->_getFileName($_title, $_styleId, $_languageId));

    if (is_array($files))
    {
        foreach ($files AS $file)
        {
            @unlink($file);
        }
    }
}