diff --git a/lib/galaxy/dataset_collections/__init__.py b/lib/galaxy/dataset_collections/__init__.py index fb6624a876b..a42180bd288 100644 --- a/lib/galaxy/dataset_collections/__init__.py +++ b/lib/galaxy/dataset_collections/__init__.py @@ -202,6 +202,10 @@ class DatasetCollectionsService( def __load_elements( self, trans, element_identifiers ): elements = odict.odict() for element_identifier in element_identifiers: + if "name" not in element_identifier: + raise RequestParameterInvalidException( + "Cannot load invalid dataset identifier - missing name - %s" % element_identifier + ) elements[ element_identifier[ "name" ] ] = self.__load_element( trans, element_identifier ) return elements diff --git a/lib/galaxy/webapps/galaxy/api/history_contents.py b/lib/galaxy/webapps/galaxy/api/history_contents.py index a550376a383..d1d90d2badb 100644 --- a/lib/galaxy/webapps/galaxy/api/history_contents.py +++ b/lib/galaxy/webapps/galaxy/api/history_contents.py @@ -295,7 +295,7 @@ class HistoryContentsController( BaseAPIController, UsesHistoryDatasetAssociatio create_params = api_payload_to_create_params( payload ) service = trans.app.dataset_collections_service dataset_collection_instance = service.create( trans, parent=history, **create_params ) - return self.__collection_dict( trans, dataset_collection_instance ) + return self.__collection_dict( trans, dataset_collection_instance, view="element" ) @expose_api_anonymous def update( self, trans, history_id, id, payload, **kwd ):