* All apps: fix broken group-favorites

This commit is contained in:
Ralf Becker 2015-09-02 13:10:19 +00:00
parent 1563f9d43a
commit 88293f3e72
2 changed files with 25 additions and 2 deletions

View File

@ -12,7 +12,7 @@
/* Basic information about this app */
$setup_info['phpgwapi']['name'] = 'phpgwapi';
$setup_info['phpgwapi']['title'] = 'EGroupware API';
$setup_info['phpgwapi']['version'] = '14.3.004';
$setup_info['phpgwapi']['version'] = '14.3.005';
$setup_info['phpgwapi']['versions']['current_header'] = '1.29';
$setup_info['phpgwapi']['enable'] = 3;
$setup_info['phpgwapi']['app_order'] = 1;

View File

@ -826,7 +826,7 @@ function phpgwapi_upgrade14_3_002()
{
$value = array(
'name' => substr($name, 9), // skip "favorite_"
'group' => !($owner > 0),
'group' => $owner < -2 ? $owner+2 : false,
'state' => $state,
);
}
@ -851,3 +851,26 @@ function phpgwapi_upgrade14_3_003()
}
return $GLOBALS['setup_info']['phpgwapi']['currentver'] = '14.3.004';
}
/**
* Fix by 14.3.003 broken group favorites
*
* @return string
*/
function phpgwapi_upgrade14_3_004()
{
$GLOBALS['run-from-upgrade14_3_004'] = true;
preferences::change_preference(null, '/^favorite_/', function($name, $value, $owner)
{
unset($name); // not used, but required by function signature
if ($value['group'] === true)
{
$value['group'] = $owner+2;
}
return $value;
});
return $GLOBALS['setup_info']['phpgwapi']['currentver'] = '14.3.005';
}