bug in LiveUser_Admin_Perm_DB_Common
| From: | Tim Glen | Date: | Fri, 12 Sep 2003 16:17:06 +0000 |
| Subject: | bug in LiveUser_Admin_Perm_DB_Common | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-7775@lists.php.net to get a copy of this message | ||
The updateTranslation() method was inserting null values because the var names being passed were not the same as the var names being used in the query.
here's the diff to make it work again.
--- pre.php Fri Sep 12 10:12:43 2003 +++ post.php Fri Sep 12 10:12:55 2003@@ -1,4 +1,4 @@
- function updateTranslation($section_id, $section_type, $language, $name, $comment = null)
+ function updateTranslation($section_id, $section_type, $language, $group_name, $group_comment = null)
{
// Get all language ids
if (DB::isError($result = $this->_getLanguages())) {
return $result;
};
// Check if language is a known one
if (!isset($this->_langs[$language])) {
return false;
};
// Update translation
$query = 'UPDATE
' . $this->prefix . 'translations
SET
name = ' . $this->dbc->quote($group_name) . ',
comment = ' . (($group_comment === null) ? 'null' : $this->dbc->quote($group_comment)) . '
WHERE
section_id = ' . (int)$section_id . ' AND
section_type = ' . (int)$section_type . ' AND
language_id = ' . (int)$this->_langs[$language];
$result = $this->dbc->query($query);
if (DB::isError($result)) {
return $result;
};
// Tranlation name (and comment) updated ...
return true;
}
--
tim glen
new media developer
nonfiction studios inc.
http://www.nonfiction.ca/