Skip to content

Commit

Permalink
Merge branch '1' into 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
GuySartorelli committed Mar 15, 2023
2 parents 503b14d + c425825 commit 3dfade2
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 8 deletions.
7 changes: 7 additions & 0 deletions _config/themes.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
Name: adminthemes
---
SilverStripe\Admin\LeftAndMain:
admin_themes:
- 'silverstripe/admin:cms-forms'
- '$default'
2 changes: 1 addition & 1 deletion client/dist/js/bundle.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion client/src/legacy/LeftAndMain.EditForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ $.entwine('ss', function($){

//Reopen toggle fields
if(toggleComposite.length > 0){
toggleComposite.accordion('activate', toggleComposite.find('.ui-accordion-header'));
toggleComposite.accordion('option', 'active', toggleComposite.find('.ui-accordion-header'));
}

//Calculate position for scroll
Expand Down
18 changes: 12 additions & 6 deletions code/LeftAndMain.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,15 +173,19 @@ class LeftAndMain extends Controller implements PermissionProvider
private string $httpErrorMessage;

/**
* Assign themes to use for cms
* Used to allow errors to be displayed using a front-end template
*/
private bool $suppressAdminErrorContext = false;

/**
* Themes to use within the CMS
*
* Default themes are assigned in _config/themes.yml
*
* @config
* @var array
*/
private static $admin_themes = [
'silverstripe/admin:cms-forms',
SSViewer::DEFAULT_THEME,
];
private static $admin_themes = [];

/**
* Codes which are required from the current user to view this controller.
Expand Down Expand Up @@ -635,6 +639,7 @@ protected function init()
),
];

$this->suppressAdminErrorContext = true;
Security::permissionFailure($this, $messageSet);
return;
}
Expand Down Expand Up @@ -760,7 +765,8 @@ protected function init()

public function afterHandleRequest()
{
if ($this->response->isError()
if (!$this->suppressAdminErrorContext
&& $this->response->isError()
&& !$this->request->isAjax()
&& $this->response->getHeader('Content-Type') !== 'application/json'
) {
Expand Down

0 comments on commit 3dfade2

Please sign in to comment.