Commit 1334b858 authored by Kevin Ditscheid's avatar Kevin Ditscheid
Browse files

[BUGFIX] Check if the editingMode is part of the available modes

If there already is an editing mode on the session, that somehow got
disabled, we need to check for that by comparing the editingMode
with the availableEditingModes.

Fixes #20
parent e08325ec
......@@ -54,7 +54,7 @@ abstract class AbstractBackendController extends AbstractController {
$editingMode = $this->session->getDataByKey('editingMode');
$availableEditingModes = $this->configurationService->getAvailableEditingModes();
if ($this->backendUser->isAdmin()) {
if (empty($editingMode)) {
if (array_key_exists($editingMode, $availableEditingModes)) {
$firstAvailableEditMode = key($availableEditingModes);
$this->session->setDataByKey('editingMode', $firstAvailableEditMode);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment