From db08865c22fc2eede016c42691c04ba6b49520fa Mon Sep 17 00:00:00 2001 From: f-osorio Date: Tue, 7 Jan 2025 15:08:33 -0500 Subject: [PATCH] Fix issue with literals in subjects The subject builder was encountering an error when there was a literal because the `uri` was `null` and `.includes()` hit an error --- src/components/panels/edit/modals/SubjectEditor.vue | 9 ++++++--- src/stores/config.js | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/components/panels/edit/modals/SubjectEditor.vue b/src/components/panels/edit/modals/SubjectEditor.vue index aded7ba4..eb65fd07 100644 --- a/src/components/panels/edit/modals/SubjectEditor.vue +++ b/src/components/panels/edit/modals/SubjectEditor.vue @@ -2486,11 +2486,14 @@ methods: { for (let component in frozenComponents){ // if (this.components[component].complex && !['madsrdf:Geographic', 'madsrdf:HierarchicalGeographic'].includes(this.components[component].type)){ const target = frozenComponents[component] - - if (!(['madsrdf:Geographic', 'madsrdf:HierarchicalGeographic'].includes(target.type) || target.uri.includes("childrensSubjects/sj")) && target.complex){ + if (!(['madsrdf:Geographic', 'madsrdf:HierarchicalGeographic'].includes(target.type) || (target.uri && target.uri.includes("childrensSubjects/sj"))) && target.complex){ let uri = target.uri let data = false //await this.parseComplexSubject(uri) //This can take a while, and is only need for the URI, but lots of things don't have URIs - data = await this.parseComplexSubject(uri) + if (uri){ + data = await this.parseComplexSubject(uri) + } else { + data = target + } let subs subs = target.marcKey.slice(5) diff --git a/src/stores/config.js b/src/stores/config.js index dd6416de..9466ce80 100644 --- a/src/stores/config.js +++ b/src/stores/config.js @@ -7,7 +7,7 @@ export const useConfigStore = defineStore('config', { versionMajor: 0, versionMinor: 17, - versionPatch: 14, + versionPatch: 15, regionUrls: {