Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Mar 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 13 additions & 7 deletions api/src/Db/Schema.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,16 +165,22 @@ function _in_index($columns, $indexs, $ignore_length_limit=false)
$columns = implode('-',$columns);
if ($ignore_length_limit) $columns = preg_replace('/\(\d+\)/', '', $columns);
}
foreach($indexs as $index)
{
if (is_array($index))

if(is_array($indexs)){

foreach($indexs as $index)
{
unset($index['options']);
$index = implode('-',$index);
if (is_array($index))
{
unset($index['options']);
$index = implode('-',$index);
}
if ($ignore_length_limit) $index = preg_replace('/\(\d+\)/', '', $index);
if ($columns == $index) return true;
}
if ($ignore_length_limit) $index = preg_replace('/\(\d+\)/', '', $index);
if ($columns == $index) return true;

}

return false;
}

Expand Down
13 changes: 9 additions & 4 deletions importexport/inc/class.importexport_definition.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -180,11 +180,16 @@ private function get_options() {
*/
private function set_options(array $_plugin_options) {
// Check conditions
foreach ( $_plugin_options['conditions'] as $key => $condition ) {
if(!$condition['string'])
{
unset($_plugin_options['conditions'][$key]);

if (is_array($_plugin_options['conditions'] )){

foreach ( $_plugin_options['conditions'] as $key => $condition ) {
if(!$condition['string'])
{
unset($_plugin_options['conditions'][$key]);
}
}

}
$this->definition['plugin_options'] = $_plugin_options;
}
Expand Down