Skip to content
Snippets Groups Projects
Commit 1b9e760e authored by Eric Bremner's avatar Eric Bremner
Browse files

ISTWCMS-4208: first attempt at unpublishing

parent 29c42318
No related branches found
No related tags found
1 merge request!19Feature/istwcms 4208 ebremner unpublishing
......@@ -79,6 +79,32 @@ class UwContentModerationForm extends ConfirmFormBase {
*/
public function submitForm(array &$form, FormStateInterface $form_state) {
// Get the node object.
$node = $this->entityTypeManager->getStorage('node')->loadRevision($this->vid);
$node->set('moderation_state', 'uw_wf_archived');
//$node->setTitle('testing2');
//$node->setPublished(0);
//$node->setPublished(FALSE);
$saved_status = $node->save();
/*
if ($node->isDefaultRevision()) {
$node->set('moderation_state', 'draft');
if ($node instanceof RevisionLogInterface) {
$node->setRevisionLogMessage($form_state->getValue('revision_log'));
$node->setRevisionUserId($this->currentUser()->id());
}
$node->status = 0;
//$node->setPublished(FALSE);
$node->save();
}
*/
// Set the options for the URL.
$options = ['absolute' => TRUE];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment