Pergunta

I am getting error when I click on "crate an account" link. Does anyone have a solution for this ?

The Error is ...

1 exception(s):
Exception #0 (Magento\Framework\Exception\LocalizedException): Invalid method Magento\Customer\Block\Form\Register::escapeHtmlAttr

Exception #0 (Magento\Framework\Exception\LocalizedException): Invalid method Magento\Customer\Block\Form\Register::escapeHtmlAttr
**#0 /var/www/html/project/app/design/frontend/Etheme/buyshop/Magento_Customer/templates/form/register.phtml(27): Magento\Framework\DataObject->__call('escapeHtmlAttr', Array)
#1 /var/www/html/project/vendor/magento/framework/View/TemplateEngine/Php.php(59): include('/var/www/html/h...')
#2 /var/www/html/project/vendor/magento/framework/View/Element/Template.php(255): Magento\Framework\View\TemplateEngine\Php->render(Object(Magento\Customer\Block\Form\Register), '/var/www/html/h...', Array)
#3 /var/www/html/project/vendor/magento/framework/View/Element/Template.php(279): Magento\Framework\View\Element\Template->fetchView('/var/www/html/h...')
#4 /var/www/html/project/vendor/magento/framework/View/Element/AbstractBlock.php(659): Magento\Framework\View\Element\Template->_toHtml()
#5 /var/www/html/project/vendor/magento/framework/View/Layout.php(542): Magento\Framework\View\Element\AbstractBlock->toHtml()
#6 /var/www/html/project/vendor/magento/framework/View/Layout.php(518): Magento\Framework\View\Layout->_renderBlock('customer_form_r...')
#7 /var/www/html/project/var/generation/Magento/Framework/View/Layout/Interceptor.php(206): Magento\Framework\View\Layout->renderNonCachedElement('customer_form_r...')
#8 /var/www/html/project/vendor/magento/framework/View/Layout.php(472): Magento\Framework\View\Layout\Interceptor->renderNonCachedElement('customer_form_r...')
#9 /var/www/html/project/var/generation/Magento/Framework/View/Layout/Interceptor.php(193): Magento\Framework\View\Layout->renderElement('customer_form_r...', true)
#10 /var/www/html/project/vendor/magento/framework/View/Layout.php(569): Magento\Framework\View\Layout\Interceptor->renderElement('customer_form_r...')
Foi útil?

Solução

It looks like your theme uses the method escapeHtmlAttr which introduced in magento 2.2 version. https://github.com/magento/magento2/commit/72b192e88250476749b1ab700c19ed0869d3f732#diff-0e10c44d6b0961dcab05891b110d0305R892

So you can try:

  • use theme compatible with magento 2.1
  • use latest version of magento
Licenciado em: CC-BY-SA com atribuição
Não afiliado a magento.stackexchange
scroll top