coopcycle / coopcycle-web

Logistics & marketplace platform. Only for worker-owned business.
https://coopcycle.org
Other
564 stars 128 forks source link

Crash when ordering as business restaurant group #4410

Closed Atala closed 3 months ago

Atala commented 3 months ago

Test instance : naofood Business restaurant group : Alois Scrat Test Entreprise account : Nao test alois Restaurant : https://naofood.coopcycle.org/fr/restaurant/26/

Crash log : https://coopcycle.sentry.io/issues/5458443945/?project=5294179&query=is%3Aunresolved+issue.priority%3A%5Bhigh%2C+medium%5D&referrer=issue-stream&statsPeriod=90d&stream_index=0

AppBundle\Service\DeliveryManager::getPrice(): Argument #2 ($ruleSet) must be of type AppBundle\Entity\Delivery\PricingRuleSet, null given, called in /home/coopcycle/.coopcycle/app/releases/34b199457e8fa41831dfc1e42e35899913b90372/src/Sylius/OrderProcessing/OrderFeeProcessor.php on line 80

lucasferraro commented 3 months ago

Commit to fix the error https://github.com/coopcycle/coopcycle-web/commit/c4a650c70927262c2f73485f32573f3877254c0c

The error is happening because of a missing configuration in the business restaurant group.

In "Settlement" section if you enable "Enable variable amount charged by the platform" and/or "Enable variable amount paid by the customer" you must choose a pricing rule set for them, see following image:

The problem is that the form was not validating that case, now the validation has been added so the user is not allowed to save successfully the changes:

https://github.com/coopcycle/coopcycle-web/assets/4819244/f18f8f72-e46f-4bf7-ae76-72d75c260c61