Browse Source

Correctif

refactoring
Guillaume Bourgeois 1 year ago
parent
commit
184f800aa9
2 changed files with 6 additions and 2 deletions
  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 View File

@@ -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 View File

@@ -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;
}
}

Loading…
Cancel
Save