Open purplespider opened 4 years ago
This still occurs in Silverstripe 4.7.3 and I believe I have finally managed to find a way to reproduce it:
In a nutshell, if a user who does not have the View any page permission tries to Archive a child page then the CMS locks up with the error.
So to reproduce:
What happens: the page is archived, but the CMS locks up with the loading indicator, and the following error is generated:
[Emergency] Uncaught Error: Call to a member function forTemplate() on null
POST /admin/pages/edit/EditForm/10/
Line 982 in /home/site/vendor/silverstripe/admin/code/LeftAndMain.php
Source
973 *
974 * @return PjaxResponseNegotiator
975 */
976 public function getResponseNegotiator()
977 {
978 if (!$this->responseNegotiator) {
979 $this->responseNegotiator = new
PjaxResponseNegotiator(
980 array(
981 'CurrentForm' => function () {
982 return
$this->getEditForm()->forTemplate();
983 },
984 'Content' => function () {
985 return
$this->renderWith($this->getTemplatesWithSuffix('_Content'));
986 },
987 'Breadcrumbs' => function () {
988 return $this->renderWith([
Note: There is no need to make any changes to the default group or page permissions to trigger this error, it occurs with the defaults.
A workaround is to enable the View any page permission on the Content Authors group, but this shouldn't be necessary.
I'm struggling to reliably reproduce this error, but it has been occasionally happening on several different Silverstripe 4.5 sites for a while now.
Sometimes when Archiving a page, the CMS locks up with a loading indicator and requires reloading. After reloading the page shows a successfully archived, but the error that occurs is:
View Full Trace
Hoping someone with more knowledge of this area may be able to identify the issue.