1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-08-07 23:03:00 +03:00

Queries: Addressed failing test cases from recent changes

This commit is contained in:
Dan Brown
2024-02-08 17:18:03 +00:00
parent ed21a6d798
commit ed9c013f6e
8 changed files with 18 additions and 12 deletions

View File

@@ -329,13 +329,14 @@ class PageContent
protected function getContentProviderClosure(bool $blankIncludes): Closure
{
$contextPage = $this->page;
$queries = $this->pageQueries;
return function (PageIncludeTag $tag) use ($blankIncludes, $contextPage): PageIncludeContent {
return function (PageIncludeTag $tag) use ($blankIncludes, $contextPage, $queries): PageIncludeContent {
if ($blankIncludes) {
return PageIncludeContent::fromHtmlAndTag('', $tag);
}
$matchedPage = $this->pageQueries->findVisibleById($tag->getPageId());
$matchedPage = $queries->findVisibleById($tag->getPageId());
$content = PageIncludeContent::fromHtmlAndTag($matchedPage->html ?? '', $tag);
if (Theme::hasListeners(ThemeEvents::PAGE_INCLUDE_PARSE)) {