Skip to content

Commit

Permalink
インストールがうまくいかなくなっていたので調整
Browse files Browse the repository at this point in the history
  • Loading branch information
ryuring committed Dec 5, 2023
1 parent 6a2fd35 commit e4a7ed8
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions plugins/baser-core/src/Model/Table/SitesTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -739,10 +739,13 @@ public function beforeSave(EventInterface $event, EntityInterface $entity, Array
public function save(EntityInterface $entity, $options = [])
{
$success = parent::save($entity, $options);
$session = Router::getRequest()->getSession();
$currentSite = $session->read('BcApp.Admin.currentSite');
if($success->id === $currentSite->id) {
$session->write('BcApp.Admin.currentSite', $success);
$request = Router::getRequest();
if($request) {
$session = Router::getRequest()->getSession();
$currentSite = $session->read('BcApp.Admin.currentSite');
if ($success->id === $currentSite->id) {
$session->write('BcApp.Admin.currentSite', $success);
}
}
return $success;
}
Expand Down

0 comments on commit e4a7ed8

Please sign in to comment.