Problem/Motivation
We have an issue that order shipping profiles are saved with empty address after updating Commerce API to 8.x-1.0-beta10.
I have found it happens since Drupal\commerce_api\Plugin\Field\FieldType\OrderProfile::propertyDefinitions() started including metatag fields to the returned list. While metatag fields are base fields they are not excluded as they are supposed to.
Steps to reproduce
- Set up a commerce site with Commerce API, Commerce Shipping and Metatag modules enabled and configured.
- Add a product to cart and go through checkout via UI as anonymous user.
- At the review step see no shipping address in the shipping information pane.
- Open order shipping profile as admin and see empty address fields in it.
Proposed resolution
We should reconsider how the base fields are excluded from the properties list.
Remaining tasks
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | commerce_api-order_profile_properties_include_base_fields-3278698-4.patch | 1.59 KB | alex.bukach |
Comments
Comment #2
alex.bukach commentedComment #3
jsacksick commentedMaybe we should be excluding computed and internal fields? the metatag module defines a computed field.
Also, this kind of conflicts with the changes from #3175106: Postal code validity is not checked when creating\updating an order address, call returns 200.
Comment #4
alex.bukach commented@jsacksick the conflict is easy to resolve.
As for checking computed and internal fields, do you have any scenario in mind then it will give a different result?
Comment #6
jsacksick commentedCommitted the patch from #4, thanks!