Browse Source

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

develop
Guillaume Bourgeois 2 years ago
parent
commit
692c22f8f4
1 changed files with 21 additions and 11 deletions
  1. +21
    -11
      Resolver/SectionResolver.php

+ 21
- 11
Resolver/SectionResolver.php View File



// admin // admin
if (isset($requestAttributesArray['_firewall_context']) && $requestAttributesArray['_firewall_context'] == 'security.firewall.map.context.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 } // front
else { else {



Loading…
Cancel
Save