Преглед на файлове

Map Locations Field: Ensure not rendered if no locations are attached.

Lacey Sanderson преди 6 години
родител
ревизия
e233dc4358
променени са 1 файла, в които са добавени 6 реда и са изтрити 0 реда
  1. 6 0
      tripal_chado/includes/TripalFields/ogi__location_on_map/ogi__location_on_map.inc

+ 6 - 0
tripal_chado/includes/TripalFields/ogi__location_on_map/ogi__location_on_map.inc

@@ -321,6 +321,12 @@ class ogi__location_on_map extends ChadoField {
         $i++;
       }
     }
+
+    // If there are no map positions expanded above then remove the stub.
+    // This is needed to ensure this field isn't displayed when there are no locations.
+    if (!isset($feature->featurepos->feature_id) OR (sizeof($feature->featurepos->feature_id) == 0)) {
+      unset($entity->{$field_name});
+    }
   }
 
 }