From 1f8e3171873d7d0dc645e83f5c3c9f0e1c7e4d6b Mon Sep 17 00:00:00 2001 From: jambun Date: Fri, 24 Aug 2018 15:16:59 +1000 Subject: [PATCH] When publishing, include the current record --- README.md | 4 ++-- backend/model/mixins/child_publisher.rb | 2 +- frontend/locales/en.yml | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 3adc44f..d555ba6 100644 --- a/README.md +++ b/README.md @@ -7,9 +7,9 @@ Developed against ArchivesSpace v2.4.0 by Hudson Molonglo for Yale University. ## Summary -Two new options are available in the `More` menu on the component toolbar for components that have children - `Publish All Children` and `Unpublish All Children`. When selected, all child components of the current component will be published or unpublished respectively. +Two new options are available in the `More` menu on the component toolbar for components that have children - `Publish this and all children` and `Unpublish all children`. When selected, all child components of the current component will be published or unpublished respectively. -The published state of the current component and its nested records is unchanged. +In the case of publication the current record is also published. When unpublishing the published state of the current component and its nested records is unchanged. The published state of some `Note` records attached to child components is also unchanged. diff --git a/backend/model/mixins/child_publisher.rb b/backend/model/mixins/child_publisher.rb index c363c8f..8a3e845 100644 --- a/backend/model/mixins/child_publisher.rb +++ b/backend/model/mixins/child_publisher.rb @@ -9,7 +9,7 @@ def _publish_children!(setting, opts) object_graph.each do |model, ids| next unless model.publishable? - model.handle_publish_flag(model == self.class ? ids.reject {|i| i == self.id} : ids, setting) + model.handle_publish_flag(model == self.class && !setting ? ids.reject {|i| i == self.id} : ids, setting) end end diff --git a/frontend/locales/en.yml b/frontend/locales/en.yml index 1130e64..e8fb3ce 100644 --- a/frontend/locales/en.yml +++ b/frontend/locales/en.yml @@ -1,8 +1,8 @@ en: plugins: child_publisher: - publish_toolbar_button: Publish All Children - unpublish_toolbar_button: Unpublish All Children + publish_toolbar_button: Publish this and all children + unpublish_toolbar_button: Unpublish all children messages: - published: Child records successfully published + published: This record and all its children successfully published unpublished: Child records successfully unpublished