Skip to content
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

Fix frontend input renderer. #113

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from
Open

Fix frontend input renderer. #113

wants to merge 3 commits into from

Conversation

mimarcel
Copy link

@mimarcel mimarcel commented Feb 7, 2016

IN SHORT:
Customer attribute "ho_import_profile" has frontend input set to "text". Because the value for the ho_import_profile attribute of a customer is an array, frontend input class Varien_Data_Form_Element_Text is unable to correctly display the value.

DETAILS:

  • Currently, when in developer mode, the following error is received when trying to edit customer in admin:

Warning: htmlspecialchars() expects parameter 1 to be string, array given in /private/var/www/lecot/htdocs/lib/Varien/Data/Form/Element/Abstract.php on line 151

#0 [internal function]: mageCoreErrorHandler(2, 'htmlspecialchar...', '/private/var/ww...', 151, Array)
#1 /private/var/www/lecot/htdocs/lib/Varien/Data/Form/Element/Abstract.php(151): htmlspecialchars(Array, 2)
#2 /private/var/www/lecot/htdocs/lib/Varien/Data/Form/Element/Abstract.php(161): Varien_Data_Form_Element_Abstract->_escape(Array)
#3 /private/var/www/lecot/htdocs/lib/Varien/Data/Form/Element/Abstract.php(178): Varien_Data_Form_Element_Abstract->getEscapedValue()
#4 /private/var/www/lecot/htdocs/app/design/adminhtml/default/default/template/widget/form/renderer/fieldset/element.phtml(40): Varien_Data_Form_Element_Abstract->getElementHtml()
#5 /private/var/www/lecot/htdocs/app/code/core/Mage/Core/Block/Template.php(241): include('/private/var/ww...')
#6 /private/var/www/lecot/htdocs/app/code/core/Mage/Core/Block/Template.php(272): Mage_Core_Block_Template->fetchView('adminhtml/defau...')
#7 /private/var/www/lecot/htdocs/app/code/core/Mage/Core/Block/Template.php(286): Mage_Core_Block_Template->renderView()
#8 /private/var/www/lecot/htdocs/app/code/core/Mage/Adminhtml/Block/Template.php(81): Mage_Core_Block_Template->_toHtml()
#9 /private/var/www/lecot/htdocs/app/code/core/Mage/Core/Block/Abstract.php(919): Mage_Adminhtml_Block_Template->_toHtml()
#10 /private/var/www/lecot/htdocs/app/code/core/Mage/Adminhtml/Block/Widget/Form/Renderer/Fieldset/Element.php(52): Mage_Core_Block_Abstract->toHtml()
#11 /private/var/www/lecot/htdocs/lib/Varien/Data/Form/Element/Abstract.php(223): Mage_Adminhtml_Block_Widget_Form_Renderer_Fieldset_Element->render(Object(Varien_Data_Form_Element_Text))
#12 /private/var/www/lecot/htdocs/lib/Varien/Data/Form/Element/Text.php(46): Varien_Data_Form_Element_Abstract->getHtml()
#13 /private/var/www/lecot/htdocs/lib/Varien/Data/Form/Element/Abstract.php(233): Varien_Data_Form_Element_Text->getHtml()
#14 /private/var/www/lecot/htdocs/lib/Varien/Data/Form/Element/Fieldset.php(90): Varien_Data_Form_Element_Abstract->toHtml()
#15 /private/var/www/lecot/htdocs/app/design/adminhtml/default/default/template/widget/form/renderer/fieldset.phtml(49): Varien_Data_Form_Element_Fieldset->getChildrenHtml()
#16 /private/var/www/lecot/htdocs/app/code/core/Mage/Core/Block/Template.php(241): include('/private/var/ww...')
#17 /private/var/www/lecot/htdocs/app/code/core/Mage/Core/Block/Template.php(272): Mage_Core_Block_Template->fetchView('adminhtml/defau...')
#18 /private/var/www/lecot/htdocs/app/code/core/Mage/Core/Block/Template.php(286): Mage_Core_Block_Template->renderView()
#19 /private/var/www/lecot/htdocs/app/code/core/Mage/Adminhtml/Block/Template.php(81): Mage_Core_Block_Template->_toHtml()
#20 /private/var/www/lecot/htdocs/app/code/core/Mage/Core/Block/Abstract.php(919): Mage_Adminhtml_Block_Template->_toHtml()
#21 /private/var/www/lecot/htdocs/app/code/core/Mage/Adminhtml/Block/Widget/Form/Renderer/Fieldset.php(51): Mage_Core_Block_Abstract->toHtml()
#22 /private/var/www/lecot/htdocs/lib/Varien/Data/Form/Element/Abstract.php(223): Mage_Adminhtml_Block_Widget_Form_Renderer_Fieldset->render(Object(Varien_Data_Form_Element_Fieldset))
#23 /private/var/www/lecot/htdocs/lib/Varien/Data/Form/Element/Abstract.php(233): Varien_Data_Form_Element_Abstract->getHtml()
#24 /private/var/www/lecot/htdocs/lib/Varien/Data/Form.php(244): Varien_Data_Form_Element_Abstract->toHtml()
#25 /private/var/www/lecot/htdocs/lib/Varien/Data/Form.php(256): Varien_Data_Form->toHtml()
#26 /private/var/www/lecot/htdocs/app/code/core/Mage/Adminhtml/Block/Widget/Form.php(108): Varien_Data_Form->getHtml()
#27 /private/var/www/lecot/htdocs/app/design/adminhtml/default/default/template/widget/form.phtml(28): Mage_Adminhtml_Block_Widget_Form->getFormHtml()
#28 /private/var/www/lecot/htdocs/app/code/core/Mage/Core/Block/Template.php(241): include('/private/var/ww...')
#29 /private/var/www/lecot/htdocs/app/code/core/Mage/Core/Block/Template.php(272): Mage_Core_Block_Template->fetchView('adminhtml/defau...')
#30 /private/var/www/lecot/htdocs/app/code/core/Mage/Core/Block/Template.php(286): Mage_Core_Block_Template->renderView()
#31 /private/var/www/lecot/htdocs/app/code/core/Mage/Adminhtml/Block/Template.php(81): Mage_Core_Block_Template->_toHtml()
#32 /private/var/www/lecot/htdocs/app/code/core/Mage/Core/Block/Abstract.php(919): Mage_Adminhtml_Block_Template->_toHtml()
#33 /private/var/www/lecot/htdocs/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tabs.php(58): Mage_Core_Block_Abstract->toHtml()
#34 /private/var/www/lecot/htdocs/app/code/core/Mage/Core/Block/Abstract.php(918): Mage_Adminhtml_Block_Customer_Edit_Tabs->_beforeToHtml()
#35 /private/var/www/lecot/htdocs/app/code/core/Mage/Core/Block/Text/List.php(43): Mage_Core_Block_Abstract->toHtml()
#36 /private/var/www/lecot/htdocs/app/code/core/Mage/Core/Block/Abstract.php(919): Mage_Core_Block_Text_List->_toHtml()
#37 /private/var/www/lecot/htdocs/app/code/core/Mage/Core/Block/Abstract.php(637): Mage_Core_Block_Abstract->toHtml()
#38 /private/var/www/lecot/htdocs/app/code/core/Mage/Core/Block/Abstract.php(581): Mage_Core_Block_Abstract->_getChildHtml('left', true)
#39 /private/var/www/lecot/htdocs/app/design/adminhtml/default/default/template/page.phtml(58): Mage_Core_Block_Abstract->getChildHtml('left')
#40 /private/var/www/lecot/htdocs/app/code/core/Mage/Core/Block/Template.php(241): include('/private/var/ww...')
#41 /private/var/www/lecot/htdocs/app/code/core/Mage/Core/Block/Template.php(272): Mage_Core_Block_Template->fetchView('adminhtml/defau...')
#42 /private/var/www/lecot/htdocs/app/code/core/Mage/Core/Block/Template.php(286): Mage_Core_Block_Template->renderView()
#43 /private/var/www/lecot/htdocs/app/code/core/Mage/Adminhtml/Block/Template.php(81): Mage_Core_Block_Template->_toHtml()
#44 /private/var/www/lecot/htdocs/app/code/core/Mage/Core/Block/Abstract.php(919): Mage_Adminhtml_Block_Template->_toHtml()
#45 /private/var/www/lecot/htdocs/app/code/core/Mage/Core/Model/Layout.php(555): Mage_Core_Block_Abstract->toHtml()
#46 /private/var/www/lecot/htdocs/app/code/core/Mage/Core/Controller/Varien/Action.php(390): Mage_Core_Model_Layout->getOutput()
#47 /private/var/www/lecot/htdocs/app/code/core/Mage/Adminhtml/controllers/CustomerController.php(151): Mage_Core_Controller_Varien_Action->renderLayout()
#48 /private/var/www/lecot/htdocs/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Adminhtml_CustomerController->editAction()
#49 /private/var/www/lecot/htdocs/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('edit')
#50 /private/var/www/lecot/htdocs/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#51 /private/var/www/lecot/htdocs/app/code/core/Mage/Core/Model/App.php(365): Mage_Core_Controller_Varien_Front->dispatch()
#52 /private/var/www/lecot/htdocs/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#53 /private/var/www/lecot/htdocs/index.php(91): Mage::run('', 'store')
#54 {main}
  • The ho_import_profile correctly works for products where frontend_input_renderer was directly specified to class class Ho_Import_Block_Adminhtml_Catalog_Product_Helper_Form_Profile.

SOLUTION

  • The ho_import_profile for customer should have the frontend input renderer set to class Ho_Import_Block_Adminhtml_Catalog_Product_Helper_Form_Profile.
  • However, customer eav attributes don't have a frontend_input_render field, so we will change frontend_input to "ho_import_profile". When Magento tries to find the renderer it will automatically find it from the frontend input to be Varien_Data_Form_Element_Ho_Import_Profile.

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.

1 participant