Fork me on GitHub
Current releases are 2.1 (gold) and 2.0.18.11 (security patch for 2.0)
Ready for 2.1? Find out if your favorite plugins are compatible.
The 2.0 branch will no longer receive updates after Dec 2014.

[Solved] any category update generates BONK : Incorrect integer value: '' for column 'Archived'*

ivanhoeivanhoe New
edited January 2012 in Questions

I have successfully installed Vanilla 2.0.18 on a W2003 server running IIS6. Any time I want to update a category, I get a BONK. Details follow:

<?xml version="1.0" encoding="utf-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> Fatal Error

Fatal Error in Gdn_Database.Query();

Incorrect integer value: '' for column 'Archived' at row 1

update GDN_Category Category set `UrlCode` = :UrlCode, `Archived` = :Archived, `Name` = :Name, `Description` = :Description, `UpdateUserID` = :UpdateUserID, `DateUpdated` = :DateUpdated, `AllowDiscussions` = :AllowDiscussions where CategoryID = :CategoryID

The error occurred on or near: C:\forums\community\library\database\class.database.php

276: 
277:          if (!is_object($PDOStatement)) {
278:             trigger_error(ErrorMessage('PDO Statement failed to prepare', $this->ClassName, 'Query', $this->GetPDOErrorMessage($this->Connection()->errorInfo())), E_USER_ERROR);
279:          } else if ($PDOStatement->execute($InputParameters) === FALSE) {
280:             trigger_error(ErrorMessage($this->GetPDOErrorMessage($PDOStatement->errorInfo()), $this->ClassName, 'Query', $Sql), E_USER_ERROR);
281:          }
282:       } else {
283:          $PDOStatement = $this->Connection()->query($Sql);
284:       }

Backtrace:

C:\forums\community\library\database\class.database.phpPHP::Gdn_ErrorHandler();
[C:\forums\community\library\database\class.database.php:280] PHP::trigger_error();
[C:\forums\community\library\database\class.sqldriver.php:1650] Gdn_Database->Query();
[C:\forums\community\library\database\class.sqldriver.php:1619] Gdn_SQLDriver->Query();
[C:\forums\community\library\core\class.model.php:276] Gdn_SQLDriver->Put();
[C:\forums\community\applications\vanilla\models\class.categorymodel.php:885] Gdn_Model->Update();
[C:\forums\community\library\core\class.form.php:1742] CategoryModel->Save();
[C:\forums\community\applications\vanilla\controllers\class.settingscontroller.php:401] Gdn_Form->Save();
[C:\forums\community\applications\vanilla\controllers\class.settingscontroller.php:401] SettingsController->EditCategory();
[C:\forums\community\library\core\class.dispatcher.php:322] PHP::call_user_func_array();
[C:\forums\community\index.php:53] Gdn_Dispatcher->Dispatch();

Variables in local scope:

[Sql] 'update GDN_Category Category set 
 `UrlCode` = :UrlCode,
 `Archived` = :Archived,
 `Name` = :Name,
 `Description` = :Description,
 `UpdateUserID` = :UpdateUserID,
 `DateUpdated` = :DateUpdated,
 `AllowDiscussions` = :AllowDiscussions
where CategoryID = :CategoryID'
[InputParameters] array (
  ':UrlCode' => 'general',
  ':Archived' => false,
  ':Name' => 'Général',
  ':Description' => 'Discussions générales',
  ':UpdateUserID' => '1',
  ':DateUpdated' => '2012-01-03 22:17:07',
  ':AllowDiscussions' => '1',
  ':CategoryID' => '1',
)
[Options] array (
  'ReturnType' => NULL,
)
[ReturnType] NULL
[PDOStatement] array (
  'queryString' => 'update GDN_Category Category set 
 `UrlCode` = :UrlCode,
 `Archived` = :Archived,
 `Name` = :Name,
 `Description` = :Description,
 `UpdateUserID` = :UpdateUserID,
 `DateUpdated` = :DateUpdated,
 `AllowDiscussions` = :AllowDiscussions
where CategoryID = :CategoryID',
)

Need Help?

If you are a user of this website, you can report this message to a website administrator.

If you are an administrator of this website, you can get help at the Vanilla Community Forums.

Additional information for support personnel:

  • Application: Vanilla
  • Application Version: 2.0.18.1
  • PHP Version: 5.3.8
  • Operating System: WINNT
  • Server Software: Microsoft-IIS/6.0
  • Referer: http://forum.lynxonline.com/community/index.php?p=/vanilla/settings/editcategory/1
  • User Agent: Mozilla/5.0 (Windows NT 5.1) AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.63 Safari/535.7
  • Request Uri: /community/index.php?p=/vanilla/settings/editcategory/1
  • Controller: Gdn_Database
  • Method: Query

Best Answer

  • x00x00 MVP
    Answer ✓

    Todd said: You can try setting that command in your config.

    $Configuration['Database']['ConnectionOptions']                = array(
                                                                      12 => FALSE, //PDO::ATTR_PERSISTENT => FALSE,
                                                                      1000 => TRUE, // PDO::MYSQL_ATTR_USE_BUFFERED_QUERY is missing in some php installations
                                                                      1002 => "set names 'utf8'; set sql_mode='TRADITIONAL'" // PDO::MYSQL_ATTR_INIT_COMMAND is missing in PHP 5.3, so I use the actual value "1002" instead
                                                                   );
    

    just a correction it should be

    1002 => "set names 'utf8', sql_mode='TRADITIONAL'

    multi statements are not permitted for MYSQL_ATTR_INIT_COMMAND as a security precaution.

    grep is your friend.

Answers

Sign In or Register to comment.