craftcms / commerce

Fully integrated ecommerce for Craft CMS.
https://craftcms.com/commerce
Other
226 stars 170 forks source link

[4.x]: `craft commerce/upgrade` doesn't seem to migrate `fullName` for Addresses #3278

Closed joshuapease closed 1 year ago

joshuapease commented 1 year ago

What happened?

Description

I'm in the process of migrating a Commerce 3 project that made use of fullName in the old Address records.

Looking at UpgradeController, and it doesn't appear that there is a check for fullName in the _createAddress() method.

https://github.com/craftcms/commerce/blob/4.3.0/src/console/controllers/UpgradeController.php#L968-L971

Steps to reproduce

  1. In Craft 3, create an address with fullName instead of firstName and lastName
  2. Upgrade to Commerce 4 and run craft commerce/upgrade
  3. Review the migrated address.

Expected behavior

I would expect the fullName field to be populated.

Actual behavior

fullName is empty.

Craft 3 DB

image

Craft 4 DB (After Upgrade)

image

Craft CMS version

4.5.3

Craft Commerce version

4.3.0

PHP version

8.1

Operating system and version

No response

Database type and version

No response

Image driver and version

No response

Installed plugins and versions

"akeneo/api-php-client": "^6.0", "born05/craft-sentry": "2.0.1", "carlcs/craft-diywidget": "3.0.0", "clubstudioltd/craft-asset-rev": "7.0.0", "craftcms/aws-s3": "2.0.3", "craftcms/cms": "4.5.3", "craftcms/commerce": "4.2.11", "craftcms/commerce-stripe": "3.1.1", "craftcms/feed-me": "5.2.0", "craftcms/redactor": "3.0.4", "enovatedesign/craft-style-inliner": "3.0.5", "enshrined/svg-sanitize": "0.16.0", "http-interop/http-factory-guzzle": "^1.0", "hubspot/api-client": "^3.1.0", "illuminate/collections": "^9.1.0", "matt-west/craft-recaptcha": "2.0.2", "mediabeastnz/craft-commerce-abandoned-cart": "2.0.2", "nystudio107/craft-retour": "4.1.13", "nystudio107/craft-seomatic": "4.0.30", "nystudio107/craft-templatecomments": "4.0.0", "nystudio107/craft-vite": "4.0.6", "percipioglobal/craft-colour-swatches": "4.3.0", "php-http/guzzle7-adapter": "^1.0", "presseddigital/linkit": "4.0.4.1", "putyourlightson/craft-elements-panel": "2.0.0", "spatie/pdf-to-image": "^2.2", "spicyweb/craft-neo": "3.8.6", "studioespresso/craft-scout": "3.1.2", "superbig/craft3-imgix": "3.0.0", "surprisehighway/craft-avatax": "3.0.1", "verbb/buttonbox": "4.2.0", "verbb/navigation": "2.0.20", "verbb/postie": "3.1.1", "verbb/super-table": "3.0.9", "verbb/tablemaker": "4.0.6", "viget/craft-classnames": "2.0.1", "viget/craft-viget-base": "5.0.3", "vlucas/phpdotenv": "^5.4.0", "yiisoft/yii2-redis": "^2.0"

joshuapease commented 1 year ago

Hi there, just checking if anyone on the Craft team can confirm if this is a bug, or intended behavior.

If it's a bug, I'll try and find time next week to submit a PR

joshuapease commented 1 year ago

I've created a PR with the fix.

It would be awesome if this could be released. We're about a week out from finishing this Craft / Commerce 4 upgrade.

joshuapease commented 1 year ago

Howdy @lukeholder! Any chance you and the team could look into this fullName migration issue while you're addressing the performance issues in commerce/upgrade - #3286