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

Update Order Status Emails sending true instead of array of emails #1987

Open
sfarrowGR opened this issue Oct 13, 2024 · 1 comment
Open
Labels
bug Something isn't working unconfirmed

Comments

@sfarrowGR
Copy link

sfarrowGR commented Oct 13, 2024

  • Lunar version: 1.0@beta
  • Laravel Version: 11.27.2
  • PHP Version: 8.3.12
  • Database Driver & Version: pgsql
  • using the Lunar Starter Kit, only changes were to add the mailer and set the db.

Expected Behaviour:

The status update completes
The email is sent
No Errors

Actual Behaviour:

Get a stack error: Only arrays and Traversables can be unpacked
Points to vendor/lunarphp/lunar/src/Support/Actions/Traits/UpdatesOrderStatus.php:135
**Note: if I do not check any emails, and just hit submit, the email is sent as expected and there is no error.

Steps To Reproduce:

On an order detail page, click the update status button
Click the checkbox for my mailer.
Select one or more client email checkboxes.
Click Submit

If I dump the $data on UpdateOrderStatus.php file near line 135, the email address key is a boolean instead of an array with the selected email addresses. When not selecting any as indicated above, the value is an array with the email address and the mail sends as expected.

I note the html for the checkbox has value="[object Object]" .

I was able to track it this far, but am unable to determine where the email addresses are actually collected.

Thanks,

@sfarrowGR sfarrowGR added bug Something isn't working unconfirmed labels Oct 13, 2024
@sfarrowGR
Copy link
Author

As an update, if there is both a biling and shipping address this works as expected. Two checkboxes are loaded with a value="[email protected]" for each. Emails are sent correctly whether you select one or both checkboxes.

When one of the addresses has no email, and only one checkbox is loaded, we get the value="[object Object]" for the single checkbox.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working unconfirmed
Projects
None yet
Development

No branches or pull requests

1 participant