From 6964a3849823324ddb94579f6ee24a4e0429c0de Mon Sep 17 00:00:00 2001 From: Louis Eveillard Date: Fri, 20 Dec 2024 18:22:44 +0100 Subject: [PATCH] FIX #1036 --- client/src/adc-core/fields/AuthorField.vue | 2 +- client/src/mixins/Authors.js | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/client/src/adc-core/fields/AuthorField.vue b/client/src/adc-core/fields/AuthorField.vue index 93d7df1c5..ad1d1da15 100644 --- a/client/src/adc-core/fields/AuthorField.vue +++ b/client/src/adc-core/fields/AuthorField.vue @@ -199,7 +199,7 @@ export default { ) { this.new_authors_paths = "noone"; } else if (Array.isArray(this.authors_paths)) { - this.new_authors_paths = this.new_authors_paths.reduce((acc, a) => { + this.new_authors_paths = this.authors_paths.reduce((acc, a) => { const author = this.getAuthor(a); if (author) acc.push(author.$path); return acc; diff --git a/client/src/mixins/Authors.js b/client/src/mixins/Authors.js index b3e47ae30..d74dae8f7 100644 --- a/client/src/mixins/Authors.js +++ b/client/src/mixins/Authors.js @@ -34,10 +34,7 @@ export default { return false; }, getAuthor(author_path) { - const folder_path = author_path.substring( - 0, - author_path.lastIndexOf("/") - ); + const folder_path = this.getParent(author_path); if (!folder_path || !this.$api.store[folder_path]) return false; return this.$api.store[folder_path].find((f) => f.$path === author_path); },