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

@@ -31,7 +31,8 @@ abstract class UserAdminController extends SovUserAdminController
foreach ($entity->getActions() as $action){
if($action->getName() == ActionDefinition::SWITCH_USER){
$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);
}
}

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

@@ -29,7 +29,8 @@ class ProductFamilyRepositoryQuery extends AbstractRepositoryQuery

$this->leftJoin('.productFamilySectionProperties', 'productFamilySectionProperties');
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;

+ 2
- 1
Repository/StoreTrait.php View File

@@ -4,7 +4,7 @@ namespace Lc\CaracoleBundle\Repository;

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

Loading…
Cancel
Save