Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timezone issue while validating slot #48

Open
maximehuran opened this issue Nov 2, 2020 · 0 comments
Open

Timezone issue while validating slot #48

maximehuran opened this issue Nov 2, 2020 · 0 comments

Comments

@maximehuran
Copy link

Description
When I choose a withdrawal for 03rd november 2020 at 9.40 am I have this error
The time slot "2020-11-03T08:40:00+00:00" is not available anymore.
My opening hours are 9am to 8pm, but during the validation, it take the GMT date time and compare it with the shop hours (not in GMT)

RuntimeException: This collection time isn't part of the recurrence. in ..../apps/sylius/vendor/tilleuls/sylius-click-n-collect-plugin/src/CollectionTime/RecurrenceInstanceFinder.php:48
Stack trace:
#0 ..../apps/sylius/vendor/tilleuls/sylius-click-n-collect-plugin/src/Validator/Constraints/SlotAvailableValidator.php(68): CoopTilleuls\SyliusClickNCollectPlugin\CollectionTime\RecurrenceInstanceFinder->__invoke(Object(App\Entity\Shipping\Shipment))
#1 ..../apps/sylius/vendor/symfony/validator/Validator/RecursiveContextualValidator.php(767): CoopTilleuls\SyliusClickNCollectPlugin\Validator\Constraints\SlotAvailableValidator->validate(Object(App\Entity\Shipping\Shipment), Object(CoopTilleuls\SyliusClickNCollectPlugin\Validator\Constraints\SlotAvailable))
#2 ..../apps/sylius/vendor/symfony/validator/Validator/RecursiveContextualValidator.php(492): Symfony\Component\Validator\Validator\RecursiveContextualValidator->validateInGroup(Object(App\Entity\Shipping\Shipment), '0000000064257b3...', Object(Symfony\Component\Validator\Mapping\ClassMetadata), 'sylius', Object(Symfony\Component\Validator\Context\ExecutionContext))
#3 ..../apps/sylius/vendor/symfony/validator/Validator/RecursiveContextualValidator.php(315): Symfony\Component\Validator\Validator\RecursiveContextualValidator->validateClassNode(Object(App\Entity\Shipping\Shipment), '0000000064257b3...', Object(Symfony\Component\Validator\Mapping\ClassMetadata), 'data.shipments[...', Array, NULL, 1, Object(Symfony\Component\Validator\Context\ExecutionContext))
#4 ..../apps/sylius/vendor/symfony/validator/Validator/RecursiveContextualValidator.php(372): Symfony\Component\Validator\Validator\RecursiveContextualValidator->validateObject(Object(App\Entity\Shipping\Shipment), 'data.shipments[...', Array, 1, Object(Symfony\Component\Validator\Context\ExecutionContext))
#5 ..../apps/sylius/vendor/symfony/validator/Validator/RecursiveContextualValidator.php(558): Symfony\Component\Validator\Validator\RecursiveContextualValidator->validateEachObjectIn(Object(Doctrine\ORM\PersistentCollection), 'data.shipments', Array, Object(Symfony\Component\Validator\Context\ExecutionContext))
#6 ..../apps/sylius/vendor/symfony/validator/Validator/RecursiveContextualValidator.php(315): Symfony\Component\Validator\Validator\RecursiveContextualValidator->validateClassNode(Object(Doctrine\ORM\PersistentCollection), '00000000642575a...', Object(Symfony\Component\Validator\Mapping\ClassMetadata), 'data.shipments', Array, NULL, 1, Object(Symfony\Component\Validator\Context\ExecutionContext))
#7 ..../apps/sylius/vendor/symfony/validator/Validator/RecursiveContextualValidator.php(666): Symfony\Component\Validator\Validator\RecursiveContextualValidator->validateObject(Object(Doctrine\ORM\PersistentCollection), 'data.shipments', Array, 1, Object(Symfony\Component\Validator\Context\ExecutionContext))
#8 ..../apps/sylius/vendor/symfony/validator/Validator/RecursiveContextualValidator.php(520): Symfony\Component\Validator\Validator\RecursiveContextualValidator->validateGenericNode(Object(Doctrine\ORM\PersistentCollection), Object(App\Entity\Order\Order), '000000006425770...', Object(Symfony\Component\Validator\Mapping\PropertyMetadata), 'data.shipments', Array, Array, 1, Object(Symfony\Component\Validator\Context\ExecutionContext))
#9 ..../apps/sylius/vendor/symfony/validator/Validator/RecursiveContextualValidator.php(315): Symfony\Component\Validator\Validator\RecursiveContextualValidator->validateClassNode(Object(App\Entity\Order\Order), '000000006425770...', Object(Symfony\Component\Validator\Mapping\ClassMetadata), 'data', Array, NULL, 1, Object(Symfony\Component\Validator\Context\ExecutionContext))
#10 ..../apps/sylius/vendor/symfony/validator/Validator/RecursiveContextualValidator.php(138): Symfony\Component\Validator\Validator\RecursiveContextualValidator->validateObject(Object(App\Entity\Order\Order), 'data', Array, 1, Object(Symfony\Component\Validator\Context\ExecutionContext))
#11 ..../apps/sylius/vendor/symfony/form/Extension/Validator/Constraints/FormValidator.php(108): Symfony\Component\Validator\Validator\RecursiveContextualValidator->validate(Object(App\Entity\Order\Order), NULL, Array)
#12 ..../apps/sylius/vendor/symfony/validator/Validator/RecursiveContextualValidator.php(767): Symfony\Component\Form\Extension\Validator\Constraints\FormValidator->validate(Object(Symfony\Component\Form\Form), Object(Symfony\Component\Form\Extension\Validator\Constraints\Form))
#13 ..../apps/sylius/vendor/symfony/validator/Validator/RecursiveContextualValidator.php(492): Symfony\Component\Validator\Validator\RecursiveContextualValidator->validateInGroup(Object(Symfony\Component\Form\Form), '0000000064257bf...', Object(Symfony\Component\Validator\Mapping\ClassMetadata), 'Default', Object(Symfony\Component\Validator\Context\ExecutionContext))
#14 ..../apps/sylius/vendor/symfony/validator/Validator/RecursiveContextualValidator.php(315): Symfony\Component\Validator\Validator\RecursiveContextualValidator->validateClassNode(Object(Symfony\Component\Form\Form), '0000000064257bf...', Object(Symfony\Component\Validator\Mapping\ClassMetadata), '', Array, NULL, 1, Object(Symfony\Component\Validator\Context\ExecutionContext))
#15 ..../apps/sylius/vendor/symfony/validator/Validator/RecursiveContextualValidator.php(138): Symfony\Component\Validator\Validator\RecursiveContextualValidator->validateObject(Object(Symfony\Component\Form\Form), '', Array, 1, Object(Symfony\Component\Validator\Context\ExecutionContext))
#16 ..../apps/sylius/vendor/symfony/validator/Validator/RecursiveValidator.php(93): Symfony\Component\Validator\Validator\RecursiveContextualValidator->validate(Object(Symfony\Component\Form\Form), NULL, Array)
#17 ..../apps/sylius/vendor/symfony/validator/Validator/TraceableValidator.php(66): Symfony\Component\Validator\Validator\RecursiveValidator->validate(Object(Symfony\Component\Form\Form), NULL, NULL)
#18 ..../apps/sylius/vendor/symfony/form/Extension/Validator/EventListener/ValidationListener.php(50): Symfony\Component\Validator\Validator\TraceableValidator->validate(Object(Symfony\Component\Form\Form))
#19 ..../apps/sylius/vendor/symfony/event-dispatcher/EventDispatcher.php(264): Symfony\Component\Form\Extension\Validator\EventListener\ValidationListener->validateForm(Object(Symfony\Component\Form\Event\PostSubmitEvent), 'form.post_submi...', Object(Symfony\Component\EventDispatcher\EventDispatcher))
#20 ..../apps/sylius/vendor/symfony/event-dispatcher/EventDispatcher.php(239): Symfony\Component\EventDispatcher\EventDispatcher->doDispatch(Array, 'form.post_submi...', Object(Symfony\Component\Form\Event\PostSubmitEvent))
#21 ..../apps/sylius/vendor/symfony/event-dispatcher/EventDispatcher.php(73): Symfony\Component\EventDispatcher\EventDispatcher->callListeners(Array, 'form.post_submi...', Object(Symfony\Component\Form\Event\PostSubmitEvent))
#22 ..../apps/sylius/vendor/symfony/event-dispatcher/ImmutableEventDispatcher.php(44): Symfony\Component\EventDispatcher\EventDispatcher->dispatch(Object(Symfony\Component\Form\Event\PostSubmitEvent), 'form.post_submi...')
#23 ..../apps/sylius/vendor/symfony/form/Form.php(671): Symfony\Component\EventDispatcher\ImmutableEventDispatcher->dispatch(Object(Symfony\Component\Form\Event\PostSubmitEvent), 'form.post_submi...')
#24 ..../apps/sylius/vendor/sylius/resource-bundle/src/Bundle/Form/Extension/HttpFoundation/HttpFoundationRequestHandler.php(107): Symfony\Component\Form\Form->submit(Array, true)
#25 ..../apps/sylius/vendor/symfony/form/Form.php(493): Sylius\Bundle\ResourceBundle\Form\Extension\HttpFoundation\HttpFoundationRequestHandler->handleRequest(Object(Symfony\Component\Form\Form), Object(Symfony\Component\HttpFoundation\Request))
#26 ..../apps/sylius/vendor/sylius/resource-bundle/src/Bundle/Controller/ResourceController.php(264): Symfony\Component\Form\Form->handleRequest(Object(Symfony\Component\HttpFoundation\Request))
#27 ..../apps/sylius/vendor/symfony/http-kernel/HttpKernel.php(158): Sylius\Bundle\ResourceBundle\Controller\ResourceController->updateAction(Object(Symfony\Component\HttpFoundation\Request))
#28 ..../apps/sylius/vendor/symfony/http-kernel/HttpKernel.php(80): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
#29 ..../apps/sylius/vendor/symfony/http-kernel/Kernel.php(201): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#30 ..../apps/sylius/public/index.php(25): Symfony\Component\HttpKernel\Kernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#31 {main}

How to reproduce

  • Create a shop with opening hours
  • Select a slot between H and H+1 (H is the first hours of opening)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant