Skip to content

Commit

Permalink
Merge branch '2.1' into 2
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Feb 23, 2024
2 parents 7fc18fc + 11d24ae commit d52a189
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/VersionedGridFieldItemRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,15 +131,15 @@ public function doArchive($data, $form)
'Archived {name} "{title}"',
[
'name' => $record->i18n_singular_name(),
'title' => Convert::raw2xml($title)
'title' => $title
]
);
$this->setFormMessage($form, $message);

//when an item is deleted, redirect to the parent controller
$controller = $this->getToplevelController();
$controller->getRequest()->addHeader('X-Pjax', 'Content'); // Force a content refresh
$controller->getResponse()->addHeader('X-Status', $message);
$controller->getResponse()->addHeader('X-Status', rawurlencode($message));
return $controller->redirect($this->getBackLink(), 302); //redirect back to admin section
}

Expand Down Expand Up @@ -183,12 +183,12 @@ public function doPublish($data, $form)
'Published {type} "{title}"',
[
'type' => $record->i18n_singular_name(),
'title' => Convert::raw2xml($record->Title)
'title' => $record->Title
]
);

$controller = $this->getToplevelController();
$controller->getResponse()->addHeader('X-Status', $message);
$controller->getResponse()->addHeader('X-Status', rawurlencode($message));

return $this->redirectAfterSave($isNewRecord);
}
Expand Down Expand Up @@ -217,13 +217,13 @@ public function doUnpublish($data, $form)
'Unpublished {name} "{title}"',
[
'name' => $record->i18n_singular_name(),
'title' => Convert::raw2xml($title)
'title' => $title
]
);
$this->setFormMessage($form, $message);

$controller = $this->getToplevelController();
$controller->getResponse()->addHeader('X-Status', $message);
$controller->getResponse()->addHeader('X-Status', rawurlencode($message));

// Redirect back to edit
return $this->redirectAfterSave(false);
Expand Down

0 comments on commit d52a189

Please sign in to comment.