Fix that preferences can't be stored in a database

The mtime column is a column to update, not a column for the where condition.

fixes #8629
This commit is contained in:
Eric Lippmann 2015-03-08 10:19:17 +01:00
parent cddcde9494
commit d414d7e395

View File

@ -203,12 +203,14 @@ class DbStore extends PreferencesStore
foreach ($preferences as $key => $value) { foreach ($preferences as $key => $value) {
$db->update( $db->update(
$this->table, $this->table,
array(self::COLUMN_VALUE => $value), array(
self::COLUMN_VALUE => $value,
self::COLUMN_MODIFIED_TIME => new Zend_Db_Expr('NOW()')
),
array( array(
self::COLUMN_USERNAME . '=?' => $this->getUser()->getUsername(), self::COLUMN_USERNAME . '=?' => $this->getUser()->getUsername(),
$db->quoteIdentifier(self::COLUMN_SECTION) . '=?' => $section, $db->quoteIdentifier(self::COLUMN_SECTION) . '=?' => $section,
$db->quoteIdentifier(self::COLUMN_PREFERENCE) . '=?' => $key, $db->quoteIdentifier(self::COLUMN_PREFERENCE) . '=?' => $key
self::COLUMN_MODIFIED_TIME => new Zend_Db_Expr('NOW()')
) )
); );
} }