Commit f7272053 authored by Kevin Ditscheid's avatar Kevin Ditscheid

[BUGFIX] Fix wrong condition for identifying allowed edit mode

parent 0685233c
......@@ -54,7 +54,7 @@ abstract class AbstractBackendController extends AbstractController {
$editingMode = $this->session->getDataByKey('editingMode');
$availableEditingModes = $this->configurationService->getAvailableEditingModes();
if ($this->backendUser->isAdmin()) {
if (array_key_exists($editingMode, $availableEditingModes)) {
if (!array_key_exists($editingMode, $availableEditingModes)) {
$firstAvailableEditMode = key($availableEditingModes);
$this->session->setDataByKey('editingMode', $firstAvailableEditMode);
}
......@@ -62,7 +62,7 @@ abstract class AbstractBackendController extends AbstractController {
} else {
$canChangeEditingModes = count($availableEditingModes) > 0
&& $this->backendUser->user['lfeditor_change_editing_modes'] !== 0;
if (!$canChangeEditingModes || empty($editingMode)) {
if (!$canChangeEditingModes || !array_key_exists($editingMode, $availableEditingModes)) {
end($availableEditingModes);
$lastAvailableEditMode = key($availableEditingModes);
$this->session->setDataByKey('editingMode', $lastAvailableEditMode);
......
Markdown is supported
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