Skip to content

[5.x] Fixed saving product and variant UI label formats#4329

Merged
nfourtythree merged 1 commit into
5.xfrom
nathaniel/com-585-5x-product-type-ui-label-format-fields-are-not-persisted-on
Jun 29, 2026
Merged

[5.x] Fixed saving product and variant UI label formats#4329
nfourtythree merged 1 commit into
5.xfrom
nathaniel/com-585-5x-product-type-ui-label-format-fields-are-not-persisted-on

Conversation

@nfourtythree

Copy link
Copy Markdown
Contributor

Related issues

#4324

@nfourtythree nfourtythree self-assigned this Jun 29, 2026
@nfourtythree nfourtythree requested a review from a team as a code owner June 29, 2026 07:10
@linear-code

linear-code Bot commented Jun 29, 2026

Copy link
Copy Markdown

COM-585

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes Craft Commerce 5.x product type settings so the Product UI Label Format and Variant UI Label Format values entered in the CP are persisted (addresses #4324).

Changes:

  • Marks productUiLabelFormat and variantUiLabelFormat as safe attributes on ProductType so they can be populated via mass assignment.
  • Maps productUiLabelFormat and variantUiLabelFormat request params onto the ProductType model in ProductTypesController::actionSaveProductType().
  • Adds a changelog entry for the fix.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/models/ProductType.php Allows UI label format fields to be assigned when constructing the model from arrays/config.
src/controllers/ProductTypesController.php Ensures the two UI label format fields are read from the POST body and saved.
CHANGELOG.md Documents the fix in Unreleased notes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread CHANGELOG.md
## Unreleased

- Fixed a bug where a Twig error would occur when creating or editing a shipping rule. ([#4321](https://github.com/craftcms/commerce/issues/4321))
- Fixed a bug where settings weren’t being saved to the project config. ([#4324](https://github.com/craftcms/commerce/issues/4324))
@nfourtythree nfourtythree merged commit a300880 into 5.x Jun 29, 2026
15 checks passed
@nfourtythree nfourtythree deleted the nathaniel/com-585-5x-product-type-ui-label-format-fields-are-not-persisted-on branch June 29, 2026 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants