From f6f5fccd0884b4102dbe0a7bb543753cbd276f6c Mon Sep 17 00:00:00 2001 From: nathan Date: Wed, 13 Oct 2021 15:34:32 -0600 Subject: [PATCH] Avoid some more PHP8 errors An error happened! (TypeError): Cannot access offset of type string on string --- ...class.importexport_wizard_basic_export_csv.inc.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/importexport/inc/class.importexport_wizard_basic_export_csv.inc.php b/importexport/inc/class.importexport_wizard_basic_export_csv.inc.php index a8b313941b..39442db9b7 100644 --- a/importexport/inc/class.importexport_wizard_basic_export_csv.inc.php +++ b/importexport/inc/class.importexport_wizard_basic_export_csv.inc.php @@ -282,12 +282,19 @@ class importexport_wizard_basic_export_csv unset ($preserv['button']); $content['set_filter']['fields'] = importexport_helper_functions::get_filter_fields( - $content['application'],$content['plugin'],$this + $content['application'], $content['plugin'], $this ); // Load existing filter from either content or definition + if(!array_key_exists('filter', $content) || !is_array($content['filter'])) + { + $content['filter'] = []; + } foreach($content['set_filter']['fields'] as $field => $settings) { - $content['set_filter'][$field] = $content['filter'][$field]; + if(array_key_exists($field, $content['filter'])) + { + $content['set_filter'][$field] = $content['filter'][$field]; + } } if(!$content['set_filter']['fields'])