From d37ee801612d21145b3470a5522705f72230e3de Mon Sep 17 00:00:00 2001 From: Klaus Leithoff Date: Tue, 20 Dec 2011 15:57:03 +0000 Subject: [PATCH] mending Warnings: Cannot use a scalar value as an array --- etemplate/inc/class.boetemplate.inc.php | 1 + etemplate/inc/class.so_sql_cf.inc.php | 1 + etemplate/inc/class.soetemplate.inc.php | 4 ++++ phpgwapi/inc/class.egw_framework.inc.php | 9 +++++---- phpgwapi/inc/class.preferences.inc.php | 1 + 5 files changed, 12 insertions(+), 4 deletions(-) diff --git a/etemplate/inc/class.boetemplate.inc.php b/etemplate/inc/class.boetemplate.inc.php index 75904ee06d..16f1b6f2fb 100644 --- a/etemplate/inc/class.boetemplate.inc.php +++ b/etemplate/inc/class.boetemplate.inc.php @@ -1124,4 +1124,5 @@ if (!function_exists('set_cell_attribute_helper')) } } // just in case someone still uses the old var +if (!is_array($GLOBALS['egw_info']['flags']['etemplate'])) $GLOBALS['egw_info']['flags']['etemplate'] = array(); $GLOBALS['egw_info']['flags']['etemplate']['loop'] =& boetemplate::$loop; diff --git a/etemplate/inc/class.so_sql_cf.inc.php b/etemplate/inc/class.so_sql_cf.inc.php index eb3af97dbb..bd55b7d6c1 100644 --- a/etemplate/inc/class.so_sql_cf.inc.php +++ b/etemplate/inc/class.so_sql_cf.inc.php @@ -187,6 +187,7 @@ class so_sql_cf extends so_sql ),__LINE__,__FILE__,false,'',$this->app) as $row) { $entry =& $entries[$row[$this->extra_id]]; + if (!is_array($entry)) $entry = array(); $field = $this->get_cf_field($row[$this->extra_key]); if ($this->allow_multiple_values && $this->is_multiple($row[$this->extra_key])) diff --git a/etemplate/inc/class.soetemplate.inc.php b/etemplate/inc/class.soetemplate.inc.php index 1405a25a2d..6b1bc64b61 100644 --- a/etemplate/inc/class.soetemplate.inc.php +++ b/etemplate/inc/class.soetemplate.inc.php @@ -362,9 +362,12 @@ class soetemplate { for ($col = 0; $col < $cols; ++$col) { + if (!is_array($this->data[$row])) $this->data[$row]=array(); $this->data[$row][$this->num2chrs($col)] = $this->empty_cell(); } } + if (!is_array($this->children)) $this->children = array(); + if (!is_array($this->children[0])) $this->children[0] = array(); $this->children[0]['type'] = 'grid'; $this->children[0]['data'] = &$this->data; $this->children[0]['rows'] = &$this->rows; @@ -553,6 +556,7 @@ class soetemplate $version = (string) $name['version']; $name = (string) $name['name']; } + $where = array(); $where[] = 'et_name LIKE '.$this->db->quote($this->sql_wildcards($name).'%'); if ($template != '' && $template != 'default') { diff --git a/phpgwapi/inc/class.egw_framework.inc.php b/phpgwapi/inc/class.egw_framework.inc.php index 91d03c8cc9..4ec6ecd973 100644 --- a/phpgwapi/inc/class.egw_framework.inc.php +++ b/phpgwapi/inc/class.egw_framework.inc.php @@ -326,7 +326,7 @@ abstract class egw_framework $app = $GLOBALS['egw_info']['flags']['currentapp']; $app = isset($GLOBALS['egw_info']['apps'][$app]) ? $GLOBALS['egw_info']['apps'][$app]['title'] : lang($app); } - + $var = array(); if($app!='wiki') $robots =''; if (substr($GLOBALS['egw_info']['server']['favicon_file'],0,4) == 'http') { @@ -710,6 +710,7 @@ abstract class egw_framework self::includeCSS($GLOBALS['egw_info']['flags']['currentapp'], 'app'); // add all css files from self::includeCSS + if (empty($css_file)) $css_file = ''; foreach(self::$css_include_files as $path) { $css_file .= '