mirror of
https://github.com/e107inc/e107.git
synced 2025-08-05 14:17:49 +02:00
Pick up and remedy failure to delete core prefs during move
This commit is contained in:
@@ -76,6 +76,16 @@ class calendar_menu_setup // must match folder name ie. <pluginfolder>_setup
|
||||
{
|
||||
$required = TRUE;
|
||||
}
|
||||
$pref = e107::pref('core'); // Core Prefs Array.
|
||||
|
||||
foreach($pref as $k=>$v)
|
||||
{
|
||||
if(substr($k, 0, 10) == 'eventpost_')
|
||||
{
|
||||
$required = TRUE; // Need to remove core prefs
|
||||
break;
|
||||
}
|
||||
}
|
||||
//print_a($data);
|
||||
return $required;
|
||||
}
|
||||
@@ -118,10 +128,31 @@ class calendar_menu_setup // must match folder name ie. <pluginfolder>_setup
|
||||
$mes->add(EC_ADINST_LAN_10, E_MESSAGE_SUCCESS);
|
||||
}
|
||||
else
|
||||
{
|
||||
$corePrefs = e107::getConfig('core'); // Core Prefs Object.
|
||||
$pref = e107::pref('core'); // Core Prefs Array.
|
||||
$removed = FALSE;
|
||||
|
||||
foreach ($calPref as $k => $v)
|
||||
{
|
||||
if (isset($pref[$k]))
|
||||
{
|
||||
$corePrefs->remove($k);
|
||||
$removed = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
if ($removed)
|
||||
{
|
||||
$corePrefs->save();
|
||||
$mes->add(EC_ADINST_LAN_11, E_MESSAGE_INFO); // Old prefs removed from core
|
||||
}
|
||||
else
|
||||
{
|
||||
$mes->add(EC_ADINST_LAN_09, E_MESSAGE_INFO); // Nothing to do - prefs already moved
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@@ -38,4 +38,5 @@ define('EC_ADINST_LAN_07', 'Error adding default category');
|
||||
define('EC_ADINST_LAN_08', 'Default category already in DB');
|
||||
define('EC_ADINST_LAN_09', 'Preferences already converted for 2.0');
|
||||
define('EC_ADINST_LAN_10', 'Preferences converted ready for 2.0');
|
||||
define('EC_ADINST_LAN_11', 'Old preferences removed from core');
|
||||
|
||||
|
Reference in New Issue
Block a user