fixed bug "infolog filter 'responsible open' does not show all items the user is responsible for", it was caused by the update of existing entries writes '' into info_responsible instead of '0'

This commit is contained in:
Ralf Becker 2006-09-26 04:50:37 +00:00
parent 0cdfa38ff5
commit a435f90c08
3 changed files with 13 additions and 4 deletions

View File

@ -385,9 +385,9 @@
//echo "soinfolog::write(,$check_modified) values="; _debug_array($values);
$info_id = (int) $values['info_id'];
if (isset($values['info_responsible']))
if (array_key_exists('info_responsible',$values)) // isset($values['info_responsible']) returns false for NULL!
{
$values['info_responsible'] = count($values['info_responsible']) ? implode(',',$values['info_responsible']) : '0';
$values['info_responsible'] = $values['info_responsible'] ? implode(',',$values['info_responsible']) : '0';
}
$table_def = $this->db->get_table_definitions('infolog',$this->info_table);
$to_write = array();

View File

@ -12,7 +12,7 @@
/* $Id$ */
$setup_info['infolog']['name'] = 'infolog';
$setup_info['infolog']['version'] = '1.2.003';
$setup_info['infolog']['version'] = '1.2.004';
$setup_info['infolog']['app_order'] = 5;
$setup_info['infolog']['tables'] = array('egw_infolog','egw_infolog_extra');
$setup_info['infolog']['enable'] = 1;

View File

@ -546,4 +546,13 @@
}
return $GLOBALS['setup_info']['infolog']['currentver'] = '1.2.003';
}
?>
$test[] = '1.2.003';
function infolog_upgrade1_2_003()
{
// fix wrong info_responsible='' --> '0'
$GLOBALS['egw_setup']->oProc->query("UPDATE egw_infolog SET info_responsible='0' WHERE info_responsible=''",__LINE__,__FILE__);
return $GLOBALS['setup_info']['infolog']['currentver'] = '1.2.004';
}