Skip to content

[COLLAB-DRAFT] ACP2E-4803: Review Customer Custom Attribute Documentation draft#440

Draft
thiaramus wants to merge 4 commits intoAdobeDocs:mainfrom
adobe-commerce-tier-4:ACP2E-4803
Draft

[COLLAB-DRAFT] ACP2E-4803: Review Customer Custom Attribute Documentation draft#440
thiaramus wants to merge 4 commits intoAdobeDocs:mainfrom
adobe-commerce-tier-4:ACP2E-4803

Conversation

@thiaramus
Copy link
Copy Markdown
Contributor

Purpose of this pull request

This pull request (PR) will add tutorials for 3 additional custom customer attribute types.

Affected pages

Links to Magento Open Source code

  • ...

thiaramus and others added 3 commits April 6, 2026 08:18
- custom-text-field-attribute: fix non-PSR-3 logger->err() call to logger->error() in both
  the step snippet and code reference (latent bug flagged in review)
- custom-boolean-attribute: normalize integer attribute settings (0/1) to PHP booleans
  (false/true) across step snippet, settings table, and code reference for consistency
  with the dropdown and multiselect tutorials; move Boolean source model FQCN to a use
  statement in the code reference per Magento CS standards
- custom-dropdown-attribute: replace Customer::ENTITY with
  CustomerMetadataInterface::ENTITY_TYPE_CUSTOMER in revert() for consistency; remove
  unused Magento\Customer\Model\Customer import; add Table source model use statement
  and replace inline FQCN in code reference
- custom-multiselect-attribute: same revert() constant fix, import cleanup, and FQCN
  replacement as dropdown

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- MD047: add missing trailing newline to boolean, dropdown, and multiselect tutorial files
- MD046: remove 4-space indent from constructor code blocks in dropdown and multiselect
  tutorials; the explanatory paragraph before the block broke list context, causing the
  linter to classify the fenced block as an indented code block

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Align the boolean tutorial with the dropdown and multiselect tutorials so
all three follow a consistent pattern. Changes:

- Implement PatchRevertableInterface alongside DataPatchInterface
- Add revert() method that calls removeAttribute() on rollback
- Store CustomerSetupFactory in constructor instead of a pre-created
  CustomerSetup instance, so both apply() and revert() can create their
  own instance independently
- Update apply() to use a local $customerSetup variable (created from
  the factory) instead of $this->customerSetup
- Add CustomerSetup and PatchRevertableInterface use statements to the
  code reference imports
- Update "Execute the data patch" section to mention setup:rollback

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 📋 Needs Review

Development

Successfully merging this pull request may close these issues.

2 participants