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

Fixed bug in setting entities on new collection. The full entity was being added but only the id was needed. It was breaking the file creation.

Stephen Ficklin преди 6 години
родител
ревизия
250afb6968
променени са 1 файла, в които са добавени 3 реда и са изтрити 2 реда
  1. 3 2
      tripal/views_handlers/tripal_views_handler_area_collections.inc

+ 3 - 2
tripal/views_handlers/tripal_views_handler_area_collections.inc

@@ -285,6 +285,7 @@ function tripal_views_handler_area_collections_form_submit($form, $form_state) {
   foreach ($results['TripalEntity'] as $entity) {
     $entities[] = $entity->id;
   }
+
   $collection = tripal_create_collection(array(
     'uid'  => $uid,
     'collection_name' => $collection_name,
@@ -428,7 +429,7 @@ function tripal_views_handler_area_collections_search_api_form_submit($form, $fo
         'fields' => array(),
       );
     }
-    $entities[$bundle]['ids'][] = $r->entity;
+    $entities[$bundle]['ids'][] = $r->entity->id;
   }
 
   // Now add the entities to the collection based on bundle.
@@ -450,4 +451,4 @@ function tripal_views_handler_area_collections_search_api_form_submit($form, $fo
       '!view' => l('data collections page', 'user/' . $user->uid . '/data-collections'),
     ))
   );
-}
+}