1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-04 13:47:31 +02:00

EONE-49 (bug)

This commit is contained in:
secretr
2010-04-15 15:33:20 +00:00
parent 4ff7c24d39
commit 80057e9587
2 changed files with 18 additions and 12 deletions

View File

@@ -536,10 +536,12 @@ class e_pref extends e_admin_model
}
// auto admin log
$new = $this->getPref();
$admin_log->logArrayDiffs($new, $old, 'LAN_FIXME');
unset($new, $old);
if(is_array($old)) // fix install problems - no old prefs available
{
$new = $this->getPref();
$admin_log->logArrayDiffs($new, $old, 'LAN_FIXME');
unset($new, $old);
}
if(e107::getDb()->db_Select_gen("REPLACE INTO `#core` (e107_name,e107_value) values ('".$this->prefid."_Backup', '".addslashes($dbdata)."') "))
{
$admin_log->logMessage('Backup of <strong>'.$this->alias.' ('.$this->prefid.')</strong> successfully created.', E_MESSAGE_DEBUG, E_MESSAGE_SUCCESS, $session_messages);
@@ -730,7 +732,7 @@ final class e_core_pref extends e_pref
'emote' => 'emote_default', //TODO include other emote packs of the user.
'menu' => 'menu_pref',
'search' => 'search_prefs',
'notify' => 'notify_prefs'
'notify' => 'notify_prefs',
);
/**

View File

@@ -563,7 +563,7 @@ class xmlClass
foreach($this->stringTags as $vl)
{
if(varset($vars[$vl][0]))
if(isset($vars[$vl]) && isset($vars[$vl][0]))
{
$vars[$vl] = $vars[$vl][0];
}
@@ -804,7 +804,7 @@ class xmlClass
{
if(!vartrue($XMLData['prefs'][$prefType]))
{
return;
return array();
}
$mes = eMessage::getInstance();
@@ -834,7 +834,7 @@ class xmlClass
public function e107Import($file,$mode='replace',$debug=FALSE)
{
$xmlArray = $this->loadXMLfile($file,'advanced');
$xmlArray = $this->loadXMLfile($file, 'advanced');
if($debug)
{
@@ -844,20 +844,24 @@ class xmlClass
}
$ret = array();
//FIXME - doesn't work from install_.php.
if(vartrue($xmlArray['prefs'])) // Save Core Prefs
{
foreach($xmlArray['prefs'] as $type=>$array)
{
$pArray = $this->e107ImportPrefs($xmlArray,$type);
if($mode == 'replace')
{
e107::getConfig($type)->setPref($pArray);
}
else
else // 'add'
{
e107::getConfig($type)->addPref($pArray); // FIXME addPref() doesn't behave the same way as setPref() with arrays.
foreach ($pArray as $pname => $pval)
{
e107::getConfig($type)->add($pname, $pval); // don't parse x/y/z
}
// e107::getConfig($type)->addPref($pArray);
}
if($debug == FALSE)
@@ -866,7 +870,7 @@ class xmlClass
}
}
}
if(vartrue($xmlArray['database']))
{
foreach($xmlArray['database']['dbTable'] as $val)