Closed danjrichardson closed 2 years ago
This is now fixed on stable
.
Thanks!
Thanks.
Just a thought though, should address validation still be considered for a cp request? With editable orders there is an edge case there to accidentally nuke address information which the validation would otherwise pick up.
I think it's easily possible to go overkill here to fix this and start making it a "feature", but thought it worth a mention as it's sometimes easy to forget that regressions can easily be introduced in situations like this.
Hi @danjrichardson
Thank you for your reply.
Certainly in a real world project that could be the case. But, as you mentioned, we don't want to over-engineer this for the demo.
We can look at this as that the editors in the admin are under less restrictions than front end customers.
Happy to take a PR if you feel like you have an ideal solution here 🙂
Thanks!
Description
When saving store information (admin/commerce/store-settings/store) the validation fails and you cannot save the form. This is due to the event rules in the
modules\Module.php
requiringfirstName
andlastName
. Commenting out the lines in the module and then re-saving works fine. https://github.com/craftcms/spoke-and-chain/blob/stable/modules/Module.php#L59-L60I've not looked into it too much but could checking
$isStoreLocation
work to conditionally add the additional firstName and lastName fields? https://github.com/craftcms/commerce/blob/356cf132f1af6dea795bdf2c42b78dfeabe59954/src/models/Address.php#L55Steps to reproduce
Additional info