Hi Jacek,
Bring in one or many of your Diem projects (the more the better
probably...) this replacement for load() function of
lib/vendor/diem/dmCorePlugin/lib/config/dmConfig.php, after having
brought dmConfig.php back to original. It will generate a log.html
file of 5-10 MB right in web/ directory with a full detail about
where the error is coming from. There are a short and a full
backtrace bypassing symfony error handling, but more efficient in my
opinion.
Also please put back to original the settings and the default
language, as you seem to say in your response as a way to fix the
issue... the goal is to catch the error.
Once you'll get one or more errors logged with the 'Too many
forwards...' (only the first error is interesting for each of the
sites), just send me zip archive to my e-mail so that I can
investigate further.
Regards,
Florian
public static function load($useCache = true)
{
$trace = date('D, d M Y H:i:s') . " - <br />";
$bTrigger = true;
if (!self::$culture)
{
if (class_exists('dmContext', false) &&
dmContext::hasInstance() && $user =
dmContext::getInstance()->getUser())
{
self::$culture = $user->getCulture();
$trace .= 'if - <br />';
}
else
{
self::$culture = sfConfig::get('sf_default_culture');
$trace .= 'else - <br />';
}
}
$trace .= 'self:culture = ' . self::$culture . ' - <br
/>';
$trace .= 'sfConfig::get(\'sf_default_culture\') = ' .
sfConfig::get('sf_default_culture') . ' - <br />';
try
{
if(self::$culture == sfConfig::get('sf_default_culture'))
{
$results = dmDb::pdo('SELECT
s.name, t.value, t.lang FROM
dm_setting s LEFT JOIN dm_setting_translation t ON
t.id=
s.id AND
t.lang = ?',
array(self::$culture))->fetchAll(PDO::FETCH_NUM);
$trace .= 'dmDb request if - <br />';
}
else
{
$results = dmDb::pdo('SELECT
s.name, t.value, t.lang FROM
dm_setting s LEFT JOIN dm_setting_translation t ON
t.id=
s.id AND
t.lang IN (?, ?)',
array(self::$culture,
sfConfig::get('sf_default_culture')))->fetchAll(PDO::FETCH_NUM);
$trace .= 'dmDb request else - <br />';
}
}
catch(PDOException $e)
{
$results = array();
$trace .= 'got PDOException ' . $e->getMessage() . ' -
<br />';
$bTrigger = true;
}
catch(Doctrine_Connection_Exception $e)
{
$results = array();
$trace .= 'got Doctrine_Connection_Exception ' .
$e->getMessage() . ' - <br />';
$bTrigger = true;
}
self::$config = array();
foreach($results as $result)
{
if (!isset(self::$config[$result[0]]) ||
isset(self::$config[$result[0]]) && $result[2] ==
self::$culture)
{
self::$config[$result[0]] = $result[1];
}
if (!isset($result[1])) $bTrigger = true;
}
if (count($results) == 0) $bTrigger = true;
if ($bTrigger)
{
$trace_backtrace='';
foreach(debug_backtrace() as $k=>$v){
if($v['function'] == "include" || $v['function'] ==
"include_once" || $v['function'] == "require_once" || $v['function']
== "require"){
$trace_backtrace .= "#".$k."
".$v['function']."(".$v['args'][0].") called at
[".$v['file'].":".$v['line']."]<br />";
}else{
$trace_backtrace .= "#".$k." ".$v['function']."()
called at [".$v['file'].":".$v['line']."]<br />";
}
}
$current_ob_content = ob_get_contents();
ob_end_clean();
ob_start();
debug_print_backtrace();
$full_trace_backtrace = ob_get_contents();
ob_end_clean();
ob_start();
echo $current_ob_content;
$trace .= var_export($results, true) . '<br />';
$trace .= $trace_backtrace . '<br/>';
$trace .= $full_trace_backtrace . '<br/>';
$handle = @fopen('log.html', 'a');
@fwrite($handle, $trace);
@fclose($handle);
}
unset($results);
self::$loaded = true;
}
Florian