Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Widget rendering error in cms block/pages #191

Conversation

mmularski
Copy link
Contributor

PR fixes problem with indexing CMS block and pages which has widget in their content.

The problem occurs in 2 cases:

  1. With the indexer set as "On Schedule"
  2. With the indexer set as "On Save" and reindexing is triggered from a different area than "frontend"

During indexing, the default area is set as "global" and Magento throws an exception "Invalid template file..." because widget template is being searched in the global area instead of "frontend". Magento has a prepared class for that case Magento\Widget\Model\Template\FilterEmulate which emulates the frontend area for rendering widget content.

@afirlejczyk
Copy link
Contributor

afirlejczyk commented Jan 23, 2020

Hi, I know this problem. It was fixed for command line.
I also push some other changes like this recently:
#179
Do you still have errors with this new changes ?

Cms Page and Block action change a little.
Changes are available in 1.9.0

@avstudnitz
Copy link

This is still a problem with indexing via Cronjob. I receive the following error message:
Invalid template file: 'Magento_PageBuilder::widget/link_href.phtml' in module: 'Magento_Catalog' block's name: 'category\widget\link_0'"
It works perfectly with indexing on the command line.

@afirlejczyk
Copy link
Contributor

afirlejczyk commented Oct 29, 2020

Hi @avstudnitz
I made new PR #351 to match latest changes, they are available in master branch.
I verify changes and problem should disappear.

@avstudnitz
Copy link

Thanks @afirlejczyk, I'll try it!

@avstudnitz
Copy link

Works like a charm :-)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants