Fixed, PHP Warning: Invalid argument supplied for foreach() in ...

This commit is contained in:
Alexandros Sigalas 2019-03-05 08:51:22 +02:00
parent 520e17c1b2
commit e5d23b93cf
2 changed files with 22 additions and 11 deletions

View File

@ -165,6 +165,9 @@ class Schema
$columns = implode('-',$columns); $columns = implode('-',$columns);
if ($ignore_length_limit) $columns = preg_replace('/\(\d+\)/', '', $columns); if ($ignore_length_limit) $columns = preg_replace('/\(\d+\)/', '', $columns);
} }
if(is_array($indexs)){
foreach($indexs as $index) foreach($indexs as $index)
{ {
if (is_array($index)) if (is_array($index))
@ -175,6 +178,9 @@ class Schema
if ($ignore_length_limit) $index = preg_replace('/\(\d+\)/', '', $index); if ($ignore_length_limit) $index = preg_replace('/\(\d+\)/', '', $index);
if ($columns == $index) return true; if ($columns == $index) return true;
} }
}
return false; return false;
} }

View File

@ -180,12 +180,17 @@ class importexport_definition implements importexport_iface_egw_record {
*/ */
private function set_options(array $_plugin_options) { private function set_options(array $_plugin_options) {
// Check conditions // Check conditions
if (is_array($_plugin_options['conditions'] )){
foreach ( $_plugin_options['conditions'] as $key => $condition ) { foreach ( $_plugin_options['conditions'] as $key => $condition ) {
if(!$condition['string']) if(!$condition['string'])
{ {
unset($_plugin_options['conditions'][$key]); unset($_plugin_options['conditions'][$key]);
} }
} }
}
$this->definition['plugin_options'] = $_plugin_options; $this->definition['plugin_options'] = $_plugin_options;
} }