Browse Source

Slight fix in html5_file upload validator

Stephen Ficklin 7 năm trước cách đây
mục cha
commit
760cbabc6a
1 tập tin đã thay đổi với 4 bổ sung1 xóa
  1. 4 1
      tripal/tripal.module

+ 4 - 1
tripal/tripal.module

@@ -1057,7 +1057,10 @@ function tripal_html5_file_validate($element, &$form_state) {
   $is_required = $element['#required'];
   $is_required = $element['#required'];
   $name = $element['#name'];
   $name = $element['#name'];
   $name = preg_replace('/[^\w]/', '_', $name);
   $name = preg_replace('/[^\w]/', '_', $name);
-  $fid = $element['#value'][$name];
+  $fid = NULL;
+  if (is_array($element['#value']) and $array_key_exists($name, $element['#value'])) {
+    $fid = $element['#value'][$name];
+  }
 
 
   // TODO: the fid should just be the $element['#value'] why isn't this
   // TODO: the fid should just be the $element['#value'] why isn't this
   // working given the tripal_html5_file_value function below.
   // working given the tripal_html5_file_value function below.