Skip to content

Critical fail: Twig processing resulting in blank page #4015

@NoNoNo

Description

@NoNoNo

Using Grav 1.8.0-beta.29 with PHP 8.5.1

With certain CMS source files, Twig processing results in a blank page (page.content is empty).

If process.twig is set to false, the page displays correctly.

I constructed a minimal test case to reproduce this issue. Please note, that in this test case no Twig features are used at all!

#!/usr/bin/env sh

composer create-project 'getgrav/grav:1.8.0-beta.29' testcase && \
cd testcase && \
cat > user/pages/01.home/default.md <<'EOT'
---
title: 'Test Case'
process:
  markdown: false
  twig: true
---

<p>
	·····, ···· ··· ··············· ··········· ··· ··. ····· ······ ··· ·······
	······, ··· ··· ················· ······· ·· ··· ····, ··· ············
	·········· ······ ····' ··· ········· ··· ·············· ···
	················ ··· ············ ····· ··· ··. ············ ·· ·· ········,
	··· ···· ·· ········.
</p>
<p>
	<a href="····://···.······-····.···/··/·······-·····.····"
		>····· ··· ····· ············· ······· ··· ················ ···
		····-········· ······· ······ ··· ······ ········</a
	>
</p>
<figure class="image-caption">
	<img
		loading="lazy"
		title="······ ···· ··· ······ ··············· ··· ····· ········· ·· ···· ···· ·· ···· (····: ·········· ··· ······-·····-············)"
		alt=""
		class="caption"
		src="/~······/······/···/······/·/·/·/·/-/····-······-···············-·····-·········-········-····-········.···?·-········"
		sizes="100vw"
		width="502"
		height="292"
	/>
	<figcaption class="">
		······ ···· ··· ······ ··············· ··· ····· ········· ·· ···· ····
		·· ···· (····: ·········· ··· ······-·····-············)
	</figcaption>
</figure>
<p>
	······ ···· ······· ·· ··· ··········· ······ ······· ··· ········· ···
	········ ·· ··· ······· ················ ········· ··················
	·······, ··· ··· ···· ·········· ··· ··········· ·········· ····. ····· ····
	···· ····· ······ ········· ·······, ····· ····· ······· ···· ·· ···
	··············· ·········· ·····. ····· ····· ··········· ··· ··········
	····· ····· ········ ··· ······ ······ ···· ···· ····· ········ ··· ···
	·············· ······ ··· ··········· ··· ···········, ············ ···
	··········· ··········· (············ ·· ··· ·············- ···
	············· ··· ················ ··················). ···········
	··············· ··· ·············· ······· ···· ·.·. ··· ······
	···············, ······· ·······, ······ ········· (······ ············ ···
	···· ··· ··. ···· ··· ··· ········ ··· ················· ············
	········ ········· ··· ·········· ······ ···), ···· ············, ······
	·····, ······ ······, ······· ····· (··· ··· ···· ······ ···· ············
	··········· ···), ······ ··········, ······· ···········, ······ ·······,
	······· ······, ······ ·······, ···· ········ ··· ········, ···· ····,
	······ ·····, ···· ·········, ······ ·········, ········ ··· ·········,
	······· ·······, ······· ······, ····· ·····, ······· ······, ········
	········, ······· ········, ····· ········, ····· ····, ···· ·····, ····
	·············, ···· ··· ·····, ····· ·······, ······· ·······, ······
	···········, ····· ········ ········, ····· ········ ··· ····· ···········.
</p>
<figure class="image-caption">
	<img
		loading="lazy"
		title="······· ··········· ·· ····· ············· ·· ······ ···· ·· ····· ····: ··· ·············· ···, ····· ····, ·· ····· ··········· ···········, ···, ··· ······ ··· ················ ·············, ··· ················ ········ ······ ··········, ··· ······ ··· ············· ··········. &ndash; ······· ···········"
		alt=""
		class="caption"
		src="/~······/······/···/······/·/·/·/·/·/·······-············-··-······-····-········.···?·-········"
		sizes="100vw"
		width="512"
		height="318"
	/>
	<figcaption class="">
		······· ··········· ·· ····· ············· ·· ······ ···· ·· ····· ····:
		··· ·············· ···, ····· ····, ·· ····· ··········· ···········,
		···, ··· ······ ··· ················ ·············, ··· ················
		········ ······ ··········, ··· ······ ··· ············· ··········.
		&ndash; ······· ···········
	</figcaption>
</figure>
<p>
	··· ········ ··· ······ ····, ······ ····· ···· ··· ·· ············
	··········· ····, ··· ·· ···· ·············, ··· ··· ··· ··············, ···
	··· ···· ··· ····, ··· ······ ····· ····· ···· ··········· ····. ···· ·····
	··· ····· ··········· ·····, ······ ··· ··· ·········· ········· ··· ·····
	············ ············· ··· ········ ··· ····· ···· ···· ······
	················ ············· ················. ····· ··· ····· ·····
	······ ············ ··········· ····· ····· ·· ··· ······ ······ ·· ···
	················· ·······, ··· ······ ········, ··· ··· ··· ········ ······
	····· ······ ·· ··· ·····, ······· ·· ·········· ··· ··········· ·········
	······. ·· ···· ·· ··· ···, ··· ··· ······ ···· ···· ······ ···· ·······
	·····, ·· ··· ············· ····· ··· ········· ··············. ········
	····· ····, ··· ···· ····· ··· ····· ····· ······ ······ ··· ··········
	··········· ···. ···· ······· ···· ··· ······················,
	··················· ········ ·········· ·· ·····, ··· ·· ······ ····
	········ ··· ·············· ···. ··· ············ ··· ··· ···········
	··········· ··· ····· ········· ········· ········· ·········· ··· ······
	···· ··· ·········· ··········· ···········, ··· ···· ······ ·····
	············· ····, ······· ··· ·· ····· ········ ········· ···········
	······ ····· ······ ····· ······ ········ ···&hellip;
</p>

EOT

php -S 'localhost:7654' 'system/router.php' &
SERVER_PID=$!
sleep 1

TESTCASE_LOG="testcase.log.html"
curl -s 'http://localhost:7654/' > "$TESTCASE_LOG"
kill -TERM "$SERVER_PID"

if grep -q '<figure class="image-caption">' "$TESTCASE_LOG"; then
	echo "SUCCESS: all ok"
else
	echo "FAIL: GravCMS processing error"
fi

echo "TESTCASE_LOG: testcase/$TESTCASE_LOG"

I tried for some hours to debug this issue, but to no avail. In my original case, the text has been in Markdown, but Markdown processing is of no significance. I replaced the actual text with ·.

Thanks and greetings
and a blessed new year!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions