From 732448a664a5cee71be1b5a2701451ba9b914440 Mon Sep 17 00:00:00 2001 From: dannylamb Date: Fri, 3 Jan 2020 12:19:55 -0400 Subject: [PATCH] Avoid PHP warning by testing pseudo_bundles before iterating. (#732) --- islandora.module | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/islandora.module b/islandora.module index 2cae32705..3d4150945 100644 --- a/islandora.module +++ b/islandora.module @@ -377,14 +377,16 @@ function islandora_entity_extra_field_info() { $pseudo_bundles = $config_factory->get(IslandoraSettingsForm::GEMINI_PSEUDO); - foreach ($pseudo_bundles as $key) { - list($bundle, $content_entity) = explode(":", $key); - $extra_field[$content_entity][$bundle]['display']['field_gemini_uri'] = [ - 'label' => t('Fedora URI'), - 'description' => t('The URI to the persistent'), - 'weight' => 100, - 'visible' => TRUE, - ]; + if (!empty($pseudo_bundles)) { + foreach ($pseudo_bundles as $key) { + list($bundle, $content_entity) = explode(":", $key); + $extra_field[$content_entity][$bundle]['display']['field_gemini_uri'] = [ + 'label' => t('Fedora URI'), + 'description' => t('The URI to the persistent'), + 'weight' => 100, + 'visible' => TRUE, + ]; + } } return $extra_field; }