From 52fe438bf839501ebc7bf2cd4c5dc46faf7f4f7f Mon Sep 17 00:00:00 2001 From: Mike Cantelon Date: Wed, 5 Jul 2023 04:41:49 +0000 Subject: [PATCH] Add IO pub. status update via REST API. (#1623) Added functionality to the information object update REST API endpoint to allow an information object's publication status to be changed. --- .../actions/informationobjectsUpdateAction.class.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/plugins/arRestApiPlugin/modules/api/actions/informationobjectsUpdateAction.class.php b/plugins/arRestApiPlugin/modules/api/actions/informationobjectsUpdateAction.class.php index 78bd2522aa..f6597e7fa3 100644 --- a/plugins/arRestApiPlugin/modules/api/actions/informationobjectsUpdateAction.class.php +++ b/plugins/arRestApiPlugin/modules/api/actions/informationobjectsUpdateAction.class.php @@ -239,6 +239,17 @@ protected function processField($field, $value) $this->io->levelOfDescriptionId = $term->id; } + break; + + case 'published': + if ($value) { + $publicationStatus = 'Published'; + } else { + $publicationStatus = 'Draft'; + } + + $this->io->setPublicationStatusByName($publicationStatus); + break; } }