* Setup: make sure interactive setup does not stall on SQL error when updating from 1.8

This commit is contained in:
Ralf Becker 2016-09-26 09:27:13 +02:00
parent 4ad4e1a5f3
commit 47a1a05227

View File

@ -1074,28 +1074,33 @@ class setup
*/
function accounts_exist()
{
if (!$this->setup_account_object()) return false;
try {
if (!$this->setup_account_object()) return false;
$this->accounts->search(array(
'type' => 'accounts',
'start' => 0,
'offset' => 2 // we only need to check 2 accounts, if we just check for not anonymous
));
$this->accounts->search(array(
'type' => 'accounts',
'start' => 0,
'offset' => 2 // we only need to check 2 accounts, if we just check for not anonymous
));
if ($this->accounts->total != 1)
{
return $this->accounts->total > 1;
if ($this->accounts->total != 1)
{
return $this->accounts->total > 1;
}
// one account, need to check it's not the anonymous one
$this->accounts->search(array(
'type' => 'accounts',
'start' => 0,
'offset' => 0,
'query_type' => 'lid',
'query' => 'anonymous',
));
}
catch (Api\Db\Exception $e) {
_egw_log_exception($e);
return false;
}
// one account, need to check it's not the anonymous one
$this->accounts->search(array(
'type' => 'accounts',
'start' => 0,
'offset' => 0,
'query_type' => 'lid',
'query' => 'anonymous',
));
return !$this->accounts->total;
}