* 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.
This commit is contained in:
Ralf Becker 2019-03-24 11:36:23 +01:00
parent 7f53f21098
commit 00fd12d651
4 changed files with 47 additions and 7 deletions

View File

@ -195,7 +195,7 @@ foreach($dirs as $path => $id)
'fs_comment' => null, 'fs_comment' => null,
'fs_content' => 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 // PostgreSQL seems to require to update the sequenz, after manually inserting id's
$oProc->UpdateSequence('egw_sqlfs','fs_id'); $oProc->UpdateSequence('egw_sqlfs','fs_id');

View File

@ -11,7 +11,7 @@
/* Basic information about this app */ /* Basic information about this app */
$setup_info['api']['name'] = 'api'; $setup_info['api']['name'] = 'api';
$setup_info['api']['title'] = 'EGroupware 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'; $setup_info['api']['versions']['current_header'] = '1.29';
// maintenance release in sync with changelog in doc/rpm-build/debian.changes // maintenance release in sync with changelog in doc/rpm-build/debian.changes
$setup_info['api']['versions']['maintenance_release'] = '17.1.20190222'; $setup_info['api']['versions']['maintenance_release'] = '17.1.20190222';

View File

@ -516,6 +516,48 @@ function api_upgrade17_1_004()
return $GLOBALS['setup_info']['api']['currentver'] = '17.1.005'; 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 * Store multiline history content as diff
@ -525,7 +567,7 @@ function api_upgrade17_1_004()
* *
* @return string new version * @return string new version
*/ */
function api_upgrade17_1_005() function api_upgrade17_9_001()
{ {
$renderer = new Horde_Text_Diff_Renderer_Unified(); $renderer = new Horde_Text_Diff_Renderer_Unified();
$start = microtime(true); $start = microtime(true);
@ -565,8 +607,8 @@ function api_upgrade17_1_005()
while($n == $junk_size); while($n == $junk_size);
$saved = number_format($saved/(1024.0*1024.0), 1); $saved = number_format($saved/(1024.0*1024.0), 1);
$time = number_format((microtime(true)-$start)/60, 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';
} }

View File

@ -498,10 +498,8 @@ class setup_process
{ {
echo '<br>process->default_records(): Including default records for ' . $appname . "\n"; echo '<br>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 $oProc = &$GLOBALS['egw_setup']->oProc; // to be compatible with old apps
include ($appdir.'default_records.inc.php'); include ($appdir.'default_records.inc.php');
$GLOBALS['egw_setup']->oProc->m_odb->transaction_commit();
} }
/* $appdata['status'] = 'C'; */ /* $appdata['status'] = 'C'; */
} }