Browse Source

Erreur 500 : argument 1 passed to Lc\SovBundle\Repository\AbstractStore::getOneById() must be of the type int, null given, called in Lc/CaracoleBundle/Controller/Product/FavoriteController.php on line 93 #411

develop
Guillaume Bourgeois 2 years ago
parent
commit
ba5aad2fdc
1 changed files with 5 additions and 2 deletions
  1. +5
    -2
      Controller/Product/FavoriteController.php

+ 5
- 2
Controller/Product/FavoriteController.php View File

private function _getProductFamily($request) private function _getProductFamily($request)
{ {
$idProductFamily = $request->request->get('idProductFamily'); $idProductFamily = $request->request->get('idProductFamily');
$productFamily = $this->getProductFamilyContainer()->getStore()->getOneById($idProductFamily);


if ($productFamily) {
if($idProductFamily) {
$productFamily = $this->getProductFamilyContainer()->getStore()->getOneById($idProductFamily);
}

if (isset($productFamily) && $productFamily) {
return $productFamily; return $productFamily;
} else { } else {
throw new \ErrorException('Ce produit est introuvable'); throw new \ErrorException('Ce produit est introuvable');

Loading…
Cancel
Save