Browse Source

Merge branch 'develop' of https://forge.laclic.fr/Laclic/CaracoleBundle into develop

packProduct
Guillaume 3 years ago
parent
commit
80ab0f2ad3
3 changed files with 6 additions and 3 deletions
  1. +2
    -1
      Controller/User/UserAdminController.php
  2. +2
    -1
      Repository/Product/ProductFamilyRepositoryQuery.php
  3. +2
    -1
      Repository/StoreTrait.php

+ 2
- 1
Controller/User/UserAdminController.php View File

foreach ($entity->getActions() as $action){ foreach ($entity->getActions() as $action){
if($action->getName() == ActionDefinition::SWITCH_USER){ if($action->getName() == ActionDefinition::SWITCH_USER){
$sectionDefault = $this->getSectionContainer()->getStore()->setMerchant($this->getMerchantCurrent())->getOneDefault(); $sectionDefault = $this->getSectionContainer()->getStore()->setMerchant($this->getMerchantCurrent())->getOneDefault();
$url = $this->generateUrl($this->getParameter('lc_sov.homepage_route'), array('_switch_user' => $entity->getInstance()->getEmail(), 'section'=> $sectionDefault));
dump($sectionDefault);
$url = $this->generateUrl($this->getParameter('lc_sov.homepage_route'), array('_switch_user' => $entity->getInstance()->getEmail(), 'section'=> $sectionDefault->getSlug()));
$action->setLinkUrl($url); $action->setLinkUrl($url);
} }
} }

+ 2
- 1
Repository/Product/ProductFamilyRepositoryQuery.php View File



$this->leftJoin('.productFamilySectionProperties', 'productFamilySectionProperties'); $this->leftJoin('.productFamilySectionProperties', 'productFamilySectionProperties');
if ($addSelect) { if ($addSelect) {
$this->addSelect('productFamilySectionProperties');
//NB : Ici le select est en commentaire car si il est actif doctrine n'hydrate pas correectement ProductFamilySectionProperties (si filtre sur section les ProductFamilySectionProperties des autres sections ne sont pas chargé et ça peut être problématique pr la gestion des stocks)
//$this->addSelect('productFamilySectionProperties');
} }
} }
return $this; return $this;

+ 2
- 1
Repository/StoreTrait.php View File



trait StoreTrait trait StoreTrait
{ {
public function resetContext(): void
public function resetContext(): self
{ {
if(method_exists($this, 'setMerchant')) { if(method_exists($this, 'setMerchant')) {
$this->setMerchant(null); $this->setMerchant(null);
if(method_exists($this, 'setSection')) { if(method_exists($this, 'setSection')) {
$this->setSection(null); $this->setSection(null);
} }
return $this;
} }
} }

Loading…
Cancel
Save