1

Getting below error after upgrade to 2.2.6: 1 exception(s): Exception #0 (ReflectionException): Class Magento\Framework\EscapeHelper does not exist

I have checked vendor/magento/framework folder and didn't found EscapeHelper file while same exist in previous versions like 2.1.7

Any idea on how we can fix the above exception? I have checked even magento core files are using EscapeHelper class in vendor\magento\module-customer\view\frontend\templates\form\login.phtml e.g. $this->helper(\Magento\Framework\EscapeHelper::class)->escapeHtmlAttr(__('Password'))

Some of custom modules in my website are also using it same way.

2 Answers 2

6

When you update magento 2.1 to 2.3 you will get this issue if your custom theme copied file from 2.1 theme. You need to find all files whish use class $this->helper(\Magento\Framework\EscapeHelper::class)-> then replace with $block->

It will resolve this issue.

1
  • 1
    running grep -rl "this->helper(\\\Magento\\\Framework\\\EscapeHelper::class)" app/design/* | xargs sed -i 's/this->helper(\\Magento\\Framework\\EscapeHelper::class)/block/g' worked for me
    – Adam
    May 11, 2020 at 14:50
1

With Magento 2.2 the methods from EscapeHelper have been moved to Magento\Framework\Escaper.

2
  • Any idea on how we can fix the above exception? I have checked even magento core files are using EscapeHelper class in vendor\magento\module-customer\view\frontend\templates\form\login.phtml e.g. $this->helper(\Magento\Framework\EscapeHelper::class)->escapeHtmlAttr(__('Password')) Oct 8, 2018 at 7:31
  • @tony111ization can you please search your extensions code for EscapeHelper? If you've found anything please add it to your question.
    – sv3n
    Oct 8, 2018 at 7:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.