XF 1.2 Options Problem

xf_phantom

Well-known member
I've played with the options, changed the contact url settings several times and at once i got this errormessage
Array to string conversion

XenForo_Application::handlePhpError()
mysqli_stmt->execute() in C:\xampp\htdocs\test1\library\Zend\Db\Statement\Mysqli.php at line 208
Zend_Db_Statement_Mysqli->_execute() in C:\xampp\htdocs\test1\library\Zend\Db\Statement.php at line 317
Zend_Db_Statement->execute() in C:\xampp\htdocs\test1\library\Zend\Db\Adapter\Abstract.php at line 479
Zend_Db_Adapter_Abstract->query() in C:\xampp\htdocs\test1\library\Zend\Db\Adapter\Abstract.php at line 632
Zend_Db_Adapter_Abstract->update() in C:\xampp\htdocs\test1\library\XenForo\DataWriter.php at line 1631
XenForo_DataWriter->_update() in C:\xampp\htdocs\test1\library\XenForo\DataWriter.php at line 1597
XenForo_DataWriter->_save() in C:\xampp\htdocs\test1\library\XenForo\DataWriter.php at line 1393
XenForo_DataWriter->save() in C:\xampp\htdocs\test1\library\XenForo\Model\Option.php at line 568
XenForo_Model_Option->updateOptions() in C:\xampp\htdocs\test1\library\XenForo\ControllerAdmin\Option.php at line 174
XenForo_ControllerAdmin_Option->actionSave() in C:\xampp\htdocs\test1\library\XenForo\FrontController.php at line 337
XenForo_FrontController->dispatch() in C:\xampp\htdocs\test1\library\XenForo\FrontController.php at line 134
XenForo_FrontController->run() in C:\xampp\htdocs\test1\admin.php at line 13

I can't remove this setting anymore=>
problem.webp

I've activated the custom url option, removed support/form and then set "default url" again...
I've tried to remove the support/forum value from the page sourcecode but nothing helped.. :/
Each time when i try to save the options, i get the Array to string conversion


The problem is the update query from the dw


PHP:
protected function _update()
   {
     foreach ($this->_getTableList() AS $tableName)
     {

       if (!($update = $this->getUpdateCondition($tableName)) || empty($this->_newData[$tableName]))
       {
         continue;
       }
  
    X('Logger')->log($this);
  $this->_db->update($tableName, $this->_newData[$tableName], $update);
     }
   }


$this->_newData[$tableName] is
Code:
Array ( [option_value] => Array ( [type] => default ) )

and because option_value is a array, the query doesn't work, but WHY the hell is it an array and how could i fix this (except to try to overwrite it in the database or use the option datawriter)
 
PHP:
  /** @var $dw XenForo_DataWriter_Option */
  $dw = XenForo_DataWriter::create('XenForo_DataWriter_Option');
  $dw->setExistingData(array('option_id' => 'contactUrl'));
  $dw->set('option_value', 'default');
  $dw->save();
worked for me, but still curios why this happened
 
Top Bottom