X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/kivitendo-erp.git/blobdiff_plain/5491ab1748703d2357949ba01050c76f51493e41..c4409bf66a835166b3a50c0de9c5bdedbb5b5c69:/SL/DB/Helper/CustomVariables.pm?ds=inline diff --git a/SL/DB/Helper/CustomVariables.pm b/SL/DB/Helper/CustomVariables.pm index e8adfe8ba..a82397c5e 100644 --- a/SL/DB/Helper/CustomVariables.pm +++ b/SL/DB/Helper/CustomVariables.pm @@ -182,7 +182,7 @@ sub _all_configs { } return $params{module} && !ref $params{module} ? $cache->{module}{$params{module}} - : $params{module} && ref $params{module} ? [ map { @{ $cache->{module}{$_} } } @{ $params{module} } ] + : $params{module} && ref $params{module} ? [ map { @{ $cache->{module}{$_} // [] } } @{ $params{module} } ] : $cache->{all}; } @@ -380,7 +380,8 @@ sub _all_invalids { # easy 2: no module in params? no validity return [] unless $params{module}; - my @module_configs = grep { $_->module eq $params{module} } @$configs; + my %wanted_modules = ref $params{module} ? map { $_ => 1 } @{ $params{module} } : ($params{module} => 1); + my @module_configs = grep { $wanted_modules{$_->module} } @$configs; return [] unless @module_configs;