Skip to content

Commit

Permalink
Merge branch '1.0' into 1.x
Browse files Browse the repository at this point in the history
  • Loading branch information
Corepex committed Mar 12, 2024
2 parents 6e22e26 + 95e2f7e commit 1126da3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public function addCondition(AbstractFilterDefinitionType $filterDefinition, Pro
} elseif (empty($value) && !$isReload && method_exists($filterDefinition, 'getPreSelect')) {
$value = $filterDefinition->getPreSelect();
if ($value instanceof ElementInterface) {
$value = $value->getId();
$value = (string)$value->getId();
}
}

Expand Down
4 changes: 3 additions & 1 deletion src/FilterService/FilterType/SelectFromMultiSelect.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ public function addCondition(AbstractFilterDefinitionType $filterDefinition, Pro
$value = $preSelect;
}

$value = trim($value);
if ($value) {
$value = trim($value);
}

$currentFilter[$field] = $value;
$db = Db::get();
Expand Down
3 changes: 3 additions & 0 deletions src/VoucherService/TokenManager/Single.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
use Knp\Component\Pager\PaginatorInterface;
use Pimcore\Bundle\EcommerceFrameworkBundle\CartManager\CartInterface;
use Pimcore\Bundle\EcommerceFrameworkBundle\Exception\InvalidConfigException;
use Pimcore\Bundle\EcommerceFrameworkBundle\Exception\VoucherServiceException;
use Pimcore\Bundle\EcommerceFrameworkBundle\Model\AbstractOrder;
use Pimcore\Bundle\EcommerceFrameworkBundle\Model\AbstractVoucherTokenType;
use Pimcore\Bundle\EcommerceFrameworkBundle\VoucherService\Reservation;
Expand Down Expand Up @@ -259,6 +260,8 @@ public function checkToken(string $code, CartInterface $cart): bool
if ($token->check((int)$this->configuration->getUsages())) {
return true;
}

throw new VoucherServiceException('Max usage limit reached.', VoucherServiceException::ERROR_CODE_NO_MORE_USAGES);
}

return false;
Expand Down

0 comments on commit 1126da3

Please sign in to comment.