From 00fd12d6517908443de97516228f09a5a7fb0623 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Sun, 24 Mar 2019 11:36:23 +0100 Subject: [PATCH] * Api/Filemanager: create in non EPL missing /templates and app-sub-directores Was caused by (unnecessary) transaction around defaul_records processing, causing during transaction inserted rows where not (yet) commited and therefore could not be read. --- api/setup/default_records.inc.php | 2 +- api/setup/setup.inc.php | 2 +- api/setup/tables_update.inc.php | 48 +++++++++++++++++++++++++-- setup/inc/class.setup_process.inc.php | 2 -- 4 files changed, 47 insertions(+), 7 deletions(-) diff --git a/api/setup/default_records.inc.php b/api/setup/default_records.inc.php index f7cfb8c618..a227c48823 100644 --- a/api/setup/default_records.inc.php +++ b/api/setup/default_records.inc.php @@ -195,7 +195,7 @@ foreach($dirs as $path => $id) 'fs_comment' => null, 'fs_content' => null, ); - $GLOBALS['egw_setup']->db->insert('egw_sqlfs',$nrow,false,__LINE__,__FILE__,'phpgwapi'); + $GLOBALS['egw_setup']->db->insert('egw_sqlfs', $nrow, false, __LINE__, __FILE__, 'api'); } // PostgreSQL seems to require to update the sequenz, after manually inserting id's $oProc->UpdateSequence('egw_sqlfs','fs_id'); diff --git a/api/setup/setup.inc.php b/api/setup/setup.inc.php index b547569510..2f7ae44077 100644 --- a/api/setup/setup.inc.php +++ b/api/setup/setup.inc.php @@ -11,7 +11,7 @@ /* Basic information about this app */ $setup_info['api']['name'] = 'api'; $setup_info['api']['title'] = 'EGroupware API'; -$setup_info['api']['version'] = '17.1.006'; +$setup_info['api']['version'] = '17.9.002'; $setup_info['api']['versions']['current_header'] = '1.29'; // maintenance release in sync with changelog in doc/rpm-build/debian.changes $setup_info['api']['versions']['maintenance_release'] = '17.1.20190222'; diff --git a/api/setup/tables_update.inc.php b/api/setup/tables_update.inc.php index bcdc14b049..6f5eedb82f 100644 --- a/api/setup/tables_update.inc.php +++ b/api/setup/tables_update.inc.php @@ -516,6 +516,48 @@ function api_upgrade17_1_004() return $GLOBALS['setup_info']['api']['currentver'] = '17.1.005'; } +/** + * Create /templates and subdirectories, if they dont exist + * + * They are create as part of the installation for new installations and allways exist in EPL. + * If they dont exist, you can not save the preferences of the concerned applications, unless + * you either manually create the directory or remove the path from the default preferences. + * + * Rerun the 16.1.002 update, as (unnecessary) transaction prevented creation on install + * with PHP MySQLi driver and probably all other drivers supporting transactions. + * + * @return string + */ +function api_upgrade17_1_005() +{ + api_upgrade16_1_002(); + + return $GLOBALS['setup_info']['api']['currentver'] = '17.1.007'; +} + +/** + * 17.1.006 used previously set after what is now the 17.9.001 update + * + * @return string + */ +function api_upgrade17_1_006() +{ + api_upgrade16_1_002(); + + return $GLOBALS['setup_info']['api']['currentver'] = '17.9.002'; +} + +/** + * Update 17.1 --> 19, can be moved, if more 17.1 updates necessary + * + * @return string + */ +function api_upgrade17_1_007() +{ + api_upgrade16_1_002(); + + return $GLOBALS['setup_info']['api']['currentver'] = '17.9.001'; +} /** * Store multiline history content as diff @@ -525,7 +567,7 @@ function api_upgrade17_1_004() * * @return string new version */ -function api_upgrade17_1_005() +function api_upgrade17_9_001() { $renderer = new Horde_Text_Diff_Renderer_Unified(); $start = microtime(true); @@ -565,8 +607,8 @@ function api_upgrade17_1_005() while($n == $junk_size); $saved = number_format($saved/(1024.0*1024.0), 1); $time = number_format((microtime(true)-$start)/60, 1); - echo "$total history-records converted in $time minutes to diff with a total of $saved MB saved\n"; + if ($total) echo "$total history-records converted in $time minutes to diff with a total of $saved MB saved\n"; - return $GLOBALS['setup_info']['api']['currentver'] = '17.1.006'; + return $GLOBALS['setup_info']['api']['currentver'] = '17.9.002'; } diff --git a/setup/inc/class.setup_process.inc.php b/setup/inc/class.setup_process.inc.php index 5498b168b1..bc01d9e505 100755 --- a/setup/inc/class.setup_process.inc.php +++ b/setup/inc/class.setup_process.inc.php @@ -498,10 +498,8 @@ class setup_process { echo '
process->default_records(): Including default records for ' . $appname . "\n"; } - $GLOBALS['egw_setup']->oProc->m_odb->transaction_begin(); $oProc = &$GLOBALS['egw_setup']->oProc; // to be compatible with old apps include ($appdir.'default_records.inc.php'); - $GLOBALS['egw_setup']->oProc->m_odb->transaction_commit(); } /* $appdata['status'] = 'C'; */ }