diff --git a/lib/galaxy/tools/parameters/dataset_matcher.py b/lib/galaxy/tools/parameters/dataset_matcher.py index e810abf538ec..4a9d2a552561 100644 --- a/lib/galaxy/tools/parameters/dataset_matcher.py +++ b/lib/galaxy/tools/parameters/dataset_matcher.py @@ -262,7 +262,7 @@ def hdca_match(self, history_dataset_collection_association): def dataset_collection_match(self, dataset_collection): # If dataset collection not yet populated, cannot determine if it # would be a valid match for this parameter. - if not dataset_collection.populated: + if not dataset_collection.populated_optimized: return False valid = True diff --git a/lib/galaxy/tools/parameters/meta.py b/lib/galaxy/tools/parameters/meta.py index f4d3a3ea26cc..fee9f6d6079e 100644 --- a/lib/galaxy/tools/parameters/meta.py +++ b/lib/galaxy/tools/parameters/meta.py @@ -242,6 +242,8 @@ def __expand_collection_parameter(trans, input_key, incoming_val, collections_to subcollection_type = None hdc_id = trans.app.security.decode_id(encoded_hdc_id) hdc = trans.sa_session.get(HistoryDatasetCollectionAssociation, hdc_id) + if not hdc.collection.populated_optimized: + raise exceptions.ToolInputsNotReadyException("An input collection is not populated.") collections_to_match.add(input_key, hdc, subcollection_type=subcollection_type, linked=linked) if subcollection_type is not None: subcollection_elements = subcollections.split_dataset_collection_instance(hdc, subcollection_type) diff --git a/lib/galaxy_test/api/test_tools.py b/lib/galaxy_test/api/test_tools.py index 7befe7f221b1..3eacb456a0ec 100644 --- a/lib/galaxy_test/api/test_tools.py +++ b/lib/galaxy_test/api/test_tools.py @@ -1659,9 +1659,8 @@ def test_map_over_collection(self, history_id): @skip_without_tool("cat1") def test_map_over_empty_collection(self, history_id): - hdca_id = self.dataset_collection_populator.create_list_in_history(history_id, contents=[]).json()["outputs"][ - 0 - ]["id"] + response = self.dataset_collection_populator.create_list_in_history(history_id, contents=[], wait=True).json() + hdca_id = response["output_collections"][0]["id"] inputs = { "input1": {"batch": True, "values": [{"src": "hdca", "id": hdca_id}]}, }