Skip to content

Commit c6683a3

Browse files
committed
session fix
1 parent 5bea0bb commit c6683a3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Plugin.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,11 +190,11 @@ function (RegisterUrlRulesEvent $event) {
190190
);
191191

192192
// Register Inertia URL rules absolutely last
193-
Event::on(Application::class, Application::EVENT_INIT, function() {
193+
Event::on(Application::class, Application::EVENT_INIT, function () {
194194
Event::on(
195195
UrlManager::class,
196196
UrlManager::EVENT_REGISTER_SITE_URL_RULES,
197-
function(RegisterUrlRulesEvent $event) {
197+
function (RegisterUrlRulesEvent $event) {
198198
$event->rules = array_merge($event->rules, [
199199
'' => 'inertia/base/index',
200200
'<catchall:.+>' => 'inertia/base/index',
@@ -253,7 +253,7 @@ function (Event $event) {
253253
Element::EVENT_AFTER_SAVE,
254254
function (ModelEvent $event) {
255255
$element = $event->sender;
256-
if (!Craft::$app->request->isConsoleRequest) {
256+
if (!Craft::$app->request->isConsoleRequest && !Craft::$app->request->isCpRequest) {
257257
Craft::$app->session->set('recentElementSave', $element->id);
258258
}
259259
}

0 commit comments

Comments
 (0)