Skip to content

Commit

Permalink
Avoid PHP warning by testing pseudo_bundles before iterating. (#732)
Browse files Browse the repository at this point in the history
  • Loading branch information
dannylamb authored Jan 3, 2020
1 parent 20477e8 commit 732448a
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions islandora.module
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 732448a

Please sign in to comment.