verbb/gift-voucher

Twig error on Redemptions with no related Order

Closed this issue · 2 comments

Describe the bug

Redemptions do not require an Order (order relations can be null). However the redemptions table in templates/codes/_fields expects an order, so a Twig error is thrown if one is not provided.

Steps to reproduce

  1. Create a Redemption using a plugin or module and do not pass it an Order.
  2. View the code in the CP and get an error (in dev mode)

Craft CMS version

3.7.51

Plugin version

2.7.1

Multi-site?

No

Additional context

The template is the same for all versions of Gift Voucher

Worth also pointing out that without an order there's also no date since the redemption date is just the order date not the date the redemption was created.

Fixed in 2.7.2