diff --git a/rdmo/management/assets/js/factories/OptionsFactory.js b/rdmo/management/assets/js/factories/OptionsFactory.js index a0b6436193..50bb461e4e 100644 --- a/rdmo/management/assets/js/factories/OptionsFactory.js +++ b/rdmo/management/assets/js/factories/OptionsFactory.js @@ -13,6 +13,7 @@ class OptionsFactory { return { model: 'options.option', uri_prefix: config.settings.default_uri_prefix, + uri_path: parent.optionset ? parent.optionset.uri_path : '', optionsets: parent.optionset ? [parent.optionset.id] : [], conditions: [], editors: config.settings.multisite ? [config.currentSite.id] : [], diff --git a/rdmo/management/assets/js/factories/QuestionsFactory.js b/rdmo/management/assets/js/factories/QuestionsFactory.js index bb8d6a47f6..47547f6af6 100644 --- a/rdmo/management/assets/js/factories/QuestionsFactory.js +++ b/rdmo/management/assets/js/factories/QuestionsFactory.js @@ -15,6 +15,7 @@ class QuestionsFactory { return { model: 'questions.section', uri_prefix: config.settings.default_uri_prefix, + uri_path: parent.catalog ? parent.catalog.uri_path : '', catalogs: parent.catalog ? [parent.catalog.id] : [], pages: [], editors: config.settings.multisite ? [config.currentSite.id] : [], @@ -25,6 +26,7 @@ class QuestionsFactory { return { model: 'questions.page', uri_prefix: config.settings.default_uri_prefix, + uri_path: parent.section ? parent.section.uri_path : '', sections: parent.section ? [parent.section.id] : [], questionsets: [], questions: [], @@ -36,6 +38,9 @@ class QuestionsFactory { return { model: 'questions.questionset', uri_prefix: config.settings.default_uri_prefix, + uri_path: parent.page ? parent.page.uri_path : ( + parent.questionset ? parent.questionset.uri_path : '' + ), pages: parent.page ? [parent.page.id] : [], parents: parent.questionset ? [parent.questionset.id] : [], questionsets: [], @@ -48,6 +53,9 @@ class QuestionsFactory { return { model: 'questions.question', uri_prefix: config.settings.default_uri_prefix, + uri_path: parent.page ? parent.page.uri_path : ( + parent.questionset ? parent.questionset.uri_path : '' + ), widget_type: 'text', value_type: 'text', pages: parent.page ? [parent.page.id] : [],