From 0990ef39618fb81f75f4430a95e681c28605e250 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 12 Jan 2014 20:02:41 +0100 Subject: [PATCH] Update code comments and add log warning to help debug --- htdocs/core/class/conf.class.php | 12 ++++++++---- htdocs/main.inc.php | 3 ++- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index 64dd4c8b9fa..903694128f9 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -156,15 +156,19 @@ class Conf if ($value && preg_match('/^MAIN_MODULE_/',$key)) { - // If this is constant for a new tab page activated by a module. + // If this is constant for a new tab page activated by a module. It initializes modules_parts['tabs']. if (preg_match('/^MAIN_MODULE_([0-9A-Z_]+)_TABS_/i',$key)) { $partname = 'tabs'; $params=explode(':',$value,2); if (! isset($this->modules_parts[$partname]) || ! is_array($this->modules_parts[$partname])) { $this->modules_parts[$partname] = array(); } - $this->modules_parts[$partname][$params[0]][]=$value; + $this->modules_parts[$partname][$params[0]][]=$value; // $value may be a string or an array } - // If this is constant for all generic part activated by a module + // If this is constant for all generic part activated by a module. It initializes + // modules_parts['login'], modules_parts['menus'], modules_parts['substitutions'], modules_parts['triggers'], modules_parts['tpl'], + // modules_parts['models'], modules_parts['theme'] + // modules_parts['sms'], + // modules_parts['css'], ... elseif (preg_match('/^MAIN_MODULE_([0-9A-Z_]+)_([A-Z]+)$/i',$key,$reg)) { $modulename = strtolower($reg[1]); @@ -176,7 +180,7 @@ class Conf else if (in_array($partname,array('models','theme'))) $value = '/'.$modulename.'/'; else if (in_array($partname,array('sms'))) $value = $modulename; else if ($value == 1) $value = '/'.$modulename.'/core/modules/'.$partname.'/'; // ex: partname = societe - $this->modules_parts[$partname] = array_merge($this->modules_parts[$partname], array($modulename => $value)); + $this->modules_parts[$partname] = array_merge($this->modules_parts[$partname], array($modulename => $value)); // $value may be a string or an array } // If this is a module constant (must be at end) elseif (preg_match('/^MAIN_MODULE_([0-9A-Z_]+)$/i',$key,$reg)) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 6ffb94a1bc9..6f535821abe 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1047,6 +1047,7 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs $filescss=(array) $filescss; // To be sure filecss is an array foreach($filescss as $cssfile) { + if (empty($cssfile)) dol_syslog("Warning: module ".$modcss." declared a css path file into its descriptor that is empty.", LOG_WARNING); // cssfile is a relative path print ''."\n".''."\n";