From 16fbfc1ac1b766eb820296128f599e6fde437245 Mon Sep 17 00:00:00 2001 From: MorganDawe Date: Thu, 20 Oct 2016 09:04:44 -0300 Subject: [PATCH] Safety check on cmodel load --- includes/ingest.form.inc | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/includes/ingest.form.inc b/includes/ingest.form.inc index e14fd4e9..f3cde3e5 100644 --- a/includes/ingest.form.inc +++ b/includes/ingest.form.inc @@ -927,11 +927,13 @@ function islandora_ingest_form_get_steps(array &$form_state) { function islandora_form_islandora_ingest_form_alter(&$form, &$form_state) { foreach ($form_state['islandora']['shared_storage']['models'] as $key => $cmodel) { $fedora_cmodel = islandora_object_load($cmodel); - $cmodel_label = $fedora_cmodel->{'label'}; - $form["contact_information_$key"] = array( - '#markup' => "

$cmodel_label


", - '#weight' => -1000, - ); + if ($fedora_cmodel) { + $form["contact_information_$key"] = array( + '#markup' => "

$fedora_cmodel->label


", + '#weight' => -1000, + ); + } + } }