Преглед на файлове

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 години
родител
ревизия
ba5aad2fdc
променени са 1 файла, в които са добавени 5 реда и са изтрити 2 реда
  1. +5
    -2
      Controller/Product/FavoriteController.php

+ 5
- 2
Controller/Product/FavoriteController.php Целия файл

@@ -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');

Loading…
Отказ
Запис