Pārlūkot izejas kodu

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 pirms 2 gadiem
vecāks
revīzija
ba5aad2fdc
1 mainītis faili ar 5 papildinājumiem un 2 dzēšanām
  1. +5
    -2
      Controller/Product/FavoriteController.php

+ 5
- 2
Controller/Product/FavoriteController.php Parādīt failu

@@ -90,9 +90,12 @@ class FavoriteController extends AbstractController
private function _getProductFamily($request)
{
$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;
} else {
throw new \ErrorException('Ce produit est introuvable');

Notiek ielāde…
Atcelt
Saglabāt