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

[AdminBundle] Re-enable templating component for search nodepages config #2630

Merged
merged 1 commit into from
Feb 2, 2020

Conversation

acrobat
Copy link
Member

@acrobat acrobat commented Jan 31, 2020

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Fixed tickets

The templating component should still be enable, otherwise we get errors in NodeSearchConfiguration. Temporary re-enable the component, so we can deprecate the remaining usages.

protected function renderCustomSearchView(
NodeTranslation $nodeTranslation,
SearchViewTemplateInterface $page,
EngineInterface $renderer
) {
$view = $page->getSearchView();
$renderContext = new RenderContext([
'locale' => $nodeTranslation->getLang(),
'page' => $page,
'indexMode' => true,
'nodetranslation' => $nodeTranslation,
]);
if ($page instanceof PageInterface) {
$request = $this->container->get('request_stack')->getCurrentRequest();
$page->service($this->container, $request, $renderContext);
}
$content = $this->removeHtml(
$renderer->render(
$view,
$renderContext->getArrayCopy()
)
);
return $content;
}
/**
* Render default search view (all indexable pageparts in the main context
* of the page)
*
* @param NodeTranslation $nodeTranslation
* @param HasPagePartsInterface $page
* @param EngineInterface $renderer
*
* @return string
*/
protected function renderDefaultSearchView(
NodeTranslation $nodeTranslation,
HasPagePartsInterface $page,
EngineInterface $renderer
) {
$pageparts = $this->indexablePagePartsService->getIndexablePageParts($page);
$view = '@KunstmaanNodeSearch/PagePart/view.html.twig';
$content = $this->removeHtml(
$renderer->render(
$view,
array(
'locale' => $nodeTranslation->getLang(),
'page' => $page,
'pageparts' => $pageparts,
'indexMode' => true,
)
)
);
return $content;
}

@acrobat acrobat added this to the 5.4.2 milestone Jan 31, 2020
Copy link

@ProfessorKuma ProfessorKuma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @, your PR needs some changes

  • It seems that you should have submitted to the latest minor branch.
  • your PR title should look like [SomeBundle] Fixed some code

@acrobat acrobat changed the title Re-enable templating component for search nodepages config [AdminBundle] Re-enable templating component for search nodepages config Jan 31, 2020
@acrobat acrobat merged commit 2d32b7b into Kunstmaan:5.4 Feb 2, 2020
@acrobat acrobat deleted the enable-templating-for-bc branch February 2, 2020 17:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants