Skip to content

Commit 691eca2

Browse files
authored
fix: do not apply admin theme if emulation is called for a different scope
Early return for non-admin areas when emulation is called but not started yet
1 parent 7d87e43 commit 691eca2

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

Plugin/ThemeAdminhtmlSwitcherPlugin.php

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,19 @@ public function __construct(
2727
*
2828
* @param Design $subject
2929
* @param string|null $themeId
30+
* @param string|null $area
3031
* @return array
3132
*/
32-
public function beforeSetDesignTheme(Design $subject, $themeId = null)
33+
public function beforeSetDesignTheme(Design $subject, $themeId = null, $area = null)
3334
{
35+
if ($area !== null && $area !== Area::AREA_ADMINHTML) {
36+
return [$themeId, $area];
37+
}
38+
3439
if ($subject->getArea() !== Area::AREA_ADMINHTML) {
35-
return [$themeId];
40+
return [$themeId, $area];
3641
}
37-
42+
3843
$isEnabled = $this->scopeConfig->isSetFlag(
3944
'admin/system_admin_design/enable_theme_adminhtml_m137',
4045
ScopeConfigInterface::SCOPE_TYPE_DEFAULT
@@ -44,6 +49,6 @@ public function beforeSetDesignTheme(Design $subject, $themeId = null)
4449
$themeId = 'MageOS/m137-admin-theme';
4550
}
4651

47-
return [$themeId];
52+
return [$themeId, $area];
4853
}
4954
}

0 commit comments

Comments
 (0)