mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-02-21 21:02:02 +01:00
* PostgreSQL: fixed not working installation (access to not yet existing table stalls transaction)
This commit is contained in:
parent
ff18eb39e2
commit
499918ee04
@ -227,7 +227,12 @@ class accounts_sql
|
|||||||
if ($data['account_id'] < 0 && class_exists('emailadmin_smtp_sql', isset($data['account_email'])))
|
if ($data['account_id'] < 0 && class_exists('emailadmin_smtp_sql', isset($data['account_email'])))
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
if (empty($data['account_email']))
|
if (isset($GLOBALS['egw_info']['apps']) && !isset($GLOBALS['egw_info']['apps']['emailadmin']) ||
|
||||||
|
isset($GLOBALS['egw_setup']) && !in_array(emailadmin_smtp_sql::TABLE, $this->db->table_names(true)))
|
||||||
|
{
|
||||||
|
// cant store email, if emailadmin not (yet) installed
|
||||||
|
}
|
||||||
|
elseif (empty($data['account_email']))
|
||||||
{
|
{
|
||||||
$this->db->delete(emailadmin_smtp_sql::TABLE, array(
|
$this->db->delete(emailadmin_smtp_sql::TABLE, array(
|
||||||
'account_id' => $data['account_id'],
|
'account_id' => $data['account_id'],
|
||||||
@ -244,7 +249,7 @@ class accounts_sql
|
|||||||
), __LINE__, __FILE__, emailadmin_smtp_sql::APP);
|
), __LINE__, __FILE__, emailadmin_smtp_sql::APP);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// ignore not (yet) existing mailaccounts table
|
// ignore not (yet) existing mailaccounts table (does NOT work in PostgreSQL, because of transaction!)
|
||||||
catch (egw_exception_db $e) {}
|
catch (egw_exception_db $e) {}
|
||||||
}
|
}
|
||||||
return $data['account_id'];
|
return $data['account_id'];
|
||||||
|
@ -1104,11 +1104,12 @@ class egw_db
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get a list of table names in the current database
|
* Get a list of table names in the current database
|
||||||
*
|
*
|
||||||
* @return array list of the tables
|
* @param boolean $just_naem=false true return array of table-names, false return old format
|
||||||
*/
|
* @return array list of the tables
|
||||||
function table_names()
|
*/
|
||||||
|
function table_names($just_name=false)
|
||||||
{
|
{
|
||||||
if (!$this->Link_ID) $this->connect();
|
if (!$this->Link_ID) $this->connect();
|
||||||
if (!$this->Link_ID)
|
if (!$this->Link_ID)
|
||||||
@ -1125,7 +1126,7 @@ class egw_db
|
|||||||
{
|
{
|
||||||
$table = strtolower($table);
|
$table = strtolower($table);
|
||||||
}
|
}
|
||||||
$result[] = array(
|
$result[] = $just_name ? $table : array(
|
||||||
'table_name' => $table,
|
'table_name' => $table,
|
||||||
'tablespace_name' => $this->Database,
|
'tablespace_name' => $this->Database,
|
||||||
'database' => $this->Database
|
'database' => $this->Database
|
||||||
|
@ -167,6 +167,16 @@ class setup_process
|
|||||||
$pass_string = implode (':', $pass);
|
$pass_string = implode (':', $pass);
|
||||||
$passing_string = implode (':', $passing);
|
$passing_string = implode (':', $passing);
|
||||||
}
|
}
|
||||||
|
try {
|
||||||
|
// flush instance cache
|
||||||
|
egw_cache::flush(egw_cache::INSTANCE);
|
||||||
|
// delete image-map, in case new apps get installed, or existing ones updated
|
||||||
|
common::delete_image_map();
|
||||||
|
}
|
||||||
|
catch(Exception $e) {
|
||||||
|
unset($e);
|
||||||
|
// ignore exception, as during a new install, there's no cache configured and therefore no need to unset
|
||||||
|
}
|
||||||
/* now return the list */
|
/* now return the list */
|
||||||
return $setup_info = array_merge($setup_info,$passed);
|
return $setup_info = array_merge($setup_info,$passed);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user