magento / magento2

Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.
http://www.magento.com
Open Software License 3.0
11.46k stars 9.28k forks source link

[Issue] Fix customer widgets to use proper formatters #38768

Open m2-assistant[bot] opened 3 months ago

m2-assistant[bot] commented 3 months ago

This issue is automatically created based on existing pull request: magento/magento2#38749: Fix customer widgets to use proper formatters


Description (*)

Many of the customer widgets does not process the id nor the name formatter if given. This MR aims to fix it by using the methods getFieldName and getFieldId which are declared within the parent class \Magento\Customer\Block\Widget\AbstractWidget.

    /**
     * @return string
     */
    public function getFieldIdFormat()
    {
        if (!$this->hasData('field_id_format')) {
            $this->setData('field_id_format', '%s');
        }
        return $this->getData('field_id_format');
    }

    /**
     * @return string
     */
    public function getFieldNameFormat()
    {
        if (!$this->hasData('field_name_format')) {
            $this->setData('field_name_format', '%s');
        }
        return $this->getData('field_name_format');
    }

    /**
     * @param string $field
     * @return string
     */
    public function getFieldId($field)
    {
        return sprintf($this->getFieldIdFormat(), $field);
    }

    /**
     * @param string $field
     * @return string
     */
    public function getFieldName($field)
    {
        return sprintf($this->getFieldNameFormat(), $field);
    }

Related Pull Requests

Fixed Issues (if relevant)

  1. Fixes magento/magento2#

Manual testing scenarios (*)

  1. ...
  2. ...

Questions or comments

Contribution checklist (*)

m2-assistant[bot] commented 3 months ago

Hi @engcom-November. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:

engcom-November commented 3 months ago

Hello @thomas-kl1,

Thank you for the report and collaboration!

Looking at the PR changes this issue can be confirmed, as the name and id are not being set by the getFieldHtml method.

github-jira-sync-bot commented 3 months ago

:white_check_mark: Jira issue https://jira.corp.adobe.com/browse/AC-12042 is successfully created for this GitHub issue.

m2-assistant[bot] commented 3 months ago

:white_check_mark: Confirmed by @engcom-November. Thank you for verifying the issue.
Issue Available: @engcom-November, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.