Quellcode durchsuchen

Correctif

refactoring
Guillaume Bourgeois vor 1 Jahr
Ursprung
Commit
184f800aa9
2 geänderte Dateien mit 6 neuen und 2 gelöschten Zeilen
  1. +5
    -1
      common/logic/PointSale/UserPointSale/Repository/UserPointSaleRepository.php
  2. +1
    -1
      producer/controllers/OrderController.php

+ 5
- 1
common/logic/PointSale/UserPointSale/Repository/UserPointSaleRepository.php Datei anzeigen

@@ -33,8 +33,12 @@ class UserPointSaleRepository extends AbstractRepository
]);
}

public function findOneUserPointSale(User $user, PointSale $pointSale)
public function findOneUserPointSale(User $user = null, PointSale $pointSale = null)
{
if(!$user || !$pointSale) {
return null;
}

return UserPointSale::find()
->where([
'id_user' => $user->id,

+ 1
- 1
producer/controllers/OrderController.php Datei anzeigen

@@ -359,7 +359,7 @@ class OrderController extends ProducerBaseController
}

$userPointSale = $userPointSaleManager->findOneUserPointSale(GlobalParam::getCurrentUser(), $pointSale);
if ($pointSale->restricted_access && !$userPointSale) {
if ($pointSale && $pointSale->restricted_access && !$userPointSale) {
$errorPointSale = true;
}
}

Laden…
Abbrechen
Speichern