2 yabba Aug 10, 2008 09:16
![](https://forums.b2evolution.net/media/users/yabba/profile_pictures/.evocache/1693279350432fc95d975f2.jpg/crop-top-80x80.jpg?mtime=1372015408)
I tried to add there $this->set_from_Request( 'description' ) but the object has empty properties.
'description' => NULL, 'longdesc' => NULL,
p.s. I already changed this function
function Chapter( $db_row = NULL, $subset_ID = NULL )
{
// Call parent constructor:
parent::GenericCategory( 'T_categories', 'cat_', 'cat_ID', $db_row );
if( is_null($db_row) )
{ // We are creating an object here:
$this->set( 'blog_ID', $subset_ID );
}
else
{ // Wa are loading an object:
$this->blog_ID = $db_row->cat_blog_ID;
$this->urlname = $db_row->cat_urlname;
$this->description = $db_row->cat_description;
$this->longdesc = $db_row->cat_longdesc;
$this->icon = $db_row->cat_icon;
}
}
Do you think it would be easier to make a simple sql query and wait for a new release :roll: ?
Probably :p
¥
Ok, fine I'll post the hack to update those new fields
This code is for update process only.
inc/chapters/chapters.ctrl.php starting line 220
// LOAD FORM DATA:
if( $edited_GenericCategory->load_from_Request() )
{ // We could load data from form without errors:
// Update in DB:
$sql = 'UPDATE T_categories SET
cat_description = '.$DB->quote($_POST['cat_description']).',
cat_longdesc = '.$DB->quote($_POST['cat_longdesc']).',
cat_icon = '.$DB->quote($_POST['cat_icon']).'
WHERE cat_ID = '.get_param('cat_ID');
$success1 = $edited_GenericCategory->dbupdate();
$success2 = $DB->query($sql);
if( $success1 !== false || $success2 !== false )
{
$Messages->add( T_('Element updated.'), 'success' ); //ToDO change htis
}
// Add the ID of the updated element to the result fadeout
$result_fadeout[$edited_GenericCategory->dbIDname][] = $edited_GenericCategory->ID;
$action = 'list';
}
Try playing with this section of code ;)
¥