Skip to content

Inconsistency: \Magento\Catalog\Block\Adminhtml\Product\Edit\Tab\Attributes::_getAdditionalElementTypes() fires the event «adminhtml_catalog_product_edit_element_types» but \Magento\Catalog\Block\Adminhtml\Category\Tab\Attributes::_getAdditionalElementTypes() does not fire a similar event #2165

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
dmitrii-fediuk opened this issue Oct 23, 2015 · 3 comments

Comments

@dmitrii-fediuk
Copy link

Method \Magento\Catalog\Block\Adminhtml\Product\Edit\Tab\Attributes::_getAdditionalElementTypes() allows an extension to add custom element types to admin product page by handling adminhtml_catalog_product_edit_element_types event:

$this->_eventManager->dispatch('adminhtml_catalog_product_edit_element_types', ['response' => $response]);

A similar method for categories \Magento\Catalog\Block\Adminhtml\Category\Tab\Attributes::_getAdditionalElementTypes() needs to do so too.

protected function _getAdditionalElementTypes()
{
return [
'image' => 'Magento\Catalog\Block\Adminhtml\Category\Helper\Image',
'textarea' => 'Magento\Catalog\Block\Adminhtml\Helper\Form\Wysiwyg'
];
}

Now an extension can add custom element types to admin product page, but can not do so for admin category page.

@dmitrii-fediuk dmitrii-fediuk changed the title Inconsistency: \Magento\Catalog\Block\Adminhtml\Product\Edit\Tab\Attributes::_getAdditionalElementTypes() fires the event «adminhtml_catalog_product_edit_element_types» but \Magento\Catalog\Block\Adminhtml\Category\Tab\Attributes::_getAdditionalElementTypes() does not Inconsistency: \Magento\Catalog\Block\Adminhtml\Product\Edit\Tab\Attributes::_getAdditionalElementTypes() fires the event «adminhtml_catalog_product_edit_element_types» but \Magento\Catalog\Block\Adminhtml\Category\Tab\Attributes::_getAdditionalElementTypes() does not fire a similar event Oct 23, 2015
@dmitrii-fediuk
Copy link
Author

My workaround solution: https://mage2.pro/t/148
It is not perfect because it overrides a core class, but I have not found a more proper solution.

@andimov
Copy link
Contributor

andimov commented Aug 2, 2016

@mage2pro

Please, format this issue according to the Issue reporting guidelines

@andimov
Copy link
Contributor

andimov commented Aug 16, 2016

According to contributor guide, tickets without response for two weeks should be closed.

@andimov andimov closed this as completed Aug 16, 2016
magento-engcom-team added a commit that referenced this issue Sep 12, 2018
…all Pull Requests delivered to Magento core #2165

 - Merge Pull Request magento-engcom/magento2ce#2165 from magento-engcom/magento2ce:MSI-1616
 - Merged commits:
   1. 5e6d06a
   2. 3db1dfa
   3. 8dde38f
   4. beac68e
   5. eb86288
   6. c69c9b8
   7. b0fc257
   8. 5e5083a
   9. 9915573
   10. 86ef47a
magento-engcom-team pushed a commit that referenced this issue Sep 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants