Explorar el Código

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 hace 2 años
padre
commit
ba5aad2fdc
Se han modificado 1 ficheros con 5 adiciones y 2 borrados
  1. +5
    -2
      Controller/Product/FavoriteController.php

+ 5
- 2
Controller/Product/FavoriteController.php Ver fichero

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

Cargando…
Cancelar
Guardar