浏览代码

Erreur 500 : Call to a member function getSlug() on null #240

develop
Guillaume Bourgeois 2 年前
父节点
当前提交
692c22f8f4
共有 1 个文件被更改,包括 21 次插入11 次删除
  1. +21
    -11
      Resolver/SectionResolver.php

+ 21
- 11
Resolver/SectionResolver.php 查看文件

@@ -53,21 +53,31 @@ class SectionResolver

// admin
if (isset($requestAttributesArray['_firewall_context']) && $requestAttributesArray['_firewall_context'] == 'security.firewall.map.context.admin') {
if (!$this->isCachedSection) {
$currentAdminSection = null;
$userMerchant = $this->merchantResolver->getUserMerchant();

if ($userMerchant !== null) {
$currentAdminSection = $userMerchant->getCurrentAdminSection();
}
if ($this->cacheSectionCurrent) {
return $this->cacheSectionCurrent;
} elseif ($returnDefaultIfOutOfSections && $this->cacheSectionDefault) {
return $this->cacheSectionDefault;
}

$this->isCachedSection = true;
$this->section = $currentAdminSection;
$sectionCurrent = null;
$userMerchant = $this->merchantResolver->getUserMerchant();
if($userMerchant !== null) {
$sectionCurrent = $userMerchant->getCurrentAdminSection();
}

return $currentAdminSection;
} else {
return $this->section;
$sectionDefault = $this->sectionStore->setMerchant($this->merchantResolver->getCurrent())->getOneDefault();

if($sectionCurrent) {
$this->cacheSectionCurrent = $sectionCurrent;
return $sectionCurrent;
} elseif($returnDefaultIfOutOfSections && $sectionDefault) {
$this->cacheSectionDefault = $sectionDefault;
return $sectionDefault;
}

return null;
} // front
else {


正在加载...
取消
保存