mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-21 23:43:17 +01:00
Avoid some PHP warnings
- Undefined array keys - Undefined class variables - Passing null to string functions
This commit is contained in:
parent
f16cfd45fe
commit
492993e78e
@ -114,7 +114,7 @@ class Date extends Transformer
|
||||
return $value;
|
||||
} // otherwise we will get current date or 1970-01-01 instead of an empty value
|
||||
|
||||
$format = $this->attrs['dataFormat'] ?? $this->attrs['data_format'];
|
||||
$format = $this->attrs['dataFormat'] ?? $this->attrs['data_format'] ?? "";
|
||||
// for DateTime objects (regular PHP and Api\DateTime ones), set user timezone
|
||||
if($value instanceof \DateTime)
|
||||
{
|
||||
|
@ -189,7 +189,7 @@ class Grid extends Box
|
||||
foreach(array_merge(array($direct_child), $n ? array() : $direct_child->children) as $child)
|
||||
{
|
||||
$pat = $child->id;
|
||||
while(($patstr = strstr($pat, '$')))
|
||||
while($pat && ($patstr = strstr($pat, '$')))
|
||||
{
|
||||
$pat = substr($patstr, $patstr[1] == '{' ? 2 : 1);
|
||||
|
||||
|
@ -136,7 +136,7 @@ class Nextmatch extends Etemplate\Widget
|
||||
}
|
||||
|
||||
// Check for sort preference. We only apply this on first load so it can be changed
|
||||
if($GLOBALS['egw_info']['user']['preferences'][$app][$this->attrs['template'] . "_sort"])
|
||||
if(array_key_exists($this->attrs['template'] . "_sort", $GLOBALS['egw_info']['user']['preferences'][$app]))
|
||||
{
|
||||
$send_value['sort'] = $GLOBALS['egw_info']['user']['preferences'][$app][$this->attrs['template'] . "_sort"];
|
||||
}
|
||||
|
@ -644,7 +644,7 @@ class Select extends Etemplate\Widget
|
||||
}
|
||||
// Legacy / static support
|
||||
// Have to do this explicitly, since legacy options is not defined on class level
|
||||
$legacy_options = explode(',',$_legacy_options);
|
||||
$legacy_options = explode(',', $_legacy_options ?? "");
|
||||
foreach($legacy_options as &$field)
|
||||
{
|
||||
$field = self::expand_name($field, 0, 0,'','',self::$cont);
|
||||
|
@ -261,6 +261,10 @@ class Hooks
|
||||
// some apps have setup_info for more then themselfs (eg. api for groupdav)
|
||||
foreach($setup_info as $appname => $data)
|
||||
{
|
||||
if(!array_key_exists('hooks', $data))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
foreach((array)$data['hooks'] as $location => $methods)
|
||||
{
|
||||
if (is_int($location))
|
||||
|
@ -51,6 +51,10 @@ class importexport_definitions_ui
|
||||
* @var object
|
||||
*/
|
||||
var $plugin;
|
||||
private Etemplate $etpl;
|
||||
private string $clock;
|
||||
private array $steps;
|
||||
private $wizard_content_template;
|
||||
|
||||
function __construct()
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user