magento2: can not do a plugin for Magento\CustomAttributeManagement\Helper\Data

Preconditions () php 7.1.26 magento 2.3.1 Steps to reproduce () create a new module in this case (My_test) Declaring a plugin

	<type name="Magento\CustomAttributeManagement\Helper\Data">
        <plugin name="My_test::HelperAttribute" type="My\test\Plugin\HelperAttribute" sortOrder="1"/>
    </type>

Defining a plugin

class HelperAttribute

{

    public function afterGetAttributeInputTypes(\Magento\CustomAttributeManagement\Helper\Data $subject, $result): array
    {
        $result['text']['validate_filters'][]      = 'regex';
        $result['multiline']['validate_filters'][] = 'regex';
        $result['date']['validate_filters'][]      = 'regex';
        return $result;
    }

    public function afterGetAttributeValidateFilters(\Magento\CustomAttributeManagement\Helper\Data $subject, $result): array
    {
        $result['regex'] = __('RetailONE Regular expression');
        return $result;
    }
}

Expected result () have the new values on the result for those functions
Actual result (
) get this when i go to …/admin/admin/customer_attribute/new/ Attribute Information

Properties Changes have been made to this section that have not been saved. This tab contains invalid data. Please resolve this before saving. 

2019-05-07_11h42_10

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 15 (3 by maintainers)

Most upvoted comments

Sorry for delay @jorgealonso78. But as You can see from the above (pull request “Changed access for $allowLengthValidationTypes #24” has been created) the progress on Your issue hasn’t stopped. Now the pull request needs to be verified. After that will have been done, it will be merged into 2.3-develop version. We’ll try to do our best in order to fulfill all the procedures as quickly as possible. Thanks for Your patience in advance.