From a314bcbdbeae3e83488d9c69027b4e1f9874feee Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Fri, 17 Jun 2022 12:08:29 +0200 Subject: [PATCH] Fix rule builder input with integer values Upload a dataset with the only content being `123`. Go to the upload module, select the `Rule-based` tab. Select `Load tabular data from: `History Dataset` and select the dataset you just uploaded. Without this fix you'd see ``` vue.runtime.esm.js?2b0e:1897 TypeError: selection.content.split is not a function at createCollectionViaRules (RuleBasedCollectionCreatorModal.js?46f9:63:1) at child.buildCollection (history-view-edit.js?0c85:387:1) at VueComponent._buildSelection (RulesInput.vue?5e16:199:1) at VueComponent._eventBuild (RulesInput.vue?5e16:164:1) at invokeWithErrorHandling (vue.runtime.esm.js?2b0e:1863:1) at HTMLButtonElement.invoker (vue.runtime.esm.js?2b0e:2184:1) at original._wrapper (vue.runtime.esm.js?2b0e:6961:1) ``` That because `selection.content` is an integer value. --- client/src/components/Upload/RulesInput.vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/client/src/components/Upload/RulesInput.vue b/client/src/components/Upload/RulesInput.vue index 79009aa76a7f..c1f2d1e0da7a 100644 --- a/client/src/components/Upload/RulesInput.vue +++ b/client/src/components/Upload/RulesInput.vue @@ -129,7 +129,11 @@ export default { .get( `${getAppRoot()}api/histories/${ Galaxy.currHistoryPanel.model.id - }/contents/${selectedDatasetId}/display` + }/contents/${selectedDatasetId}/display`, + // The Rule builder expects strings, we should not parse the respone to the default JSON type + { + responseType: "text", + } ) .then((response) => { this.sourceContent = response.data;