Skip to content

Conversation

@markconroy
Copy link
Member

Closes #188

What does this change?

Simple check to see if the body field exists before we act on it.

How to test

Delete body field from guide page content type, the pageHeader block will cause a WSOD. Checkout this branch, clear your cache, and then refresh your page and the pageHeader block should be working again.

@markconroy markconroy requested review from ekes and finnlewis May 2, 2025 09:52
$this->drupalGet($overview->toUrl()->toString());
$this->assertSession()->responseNotContains('Lede to show');
// @todo remove this.
drupal_flush_all_caches();
Copy link
Member

Choose a reason for hiding this comment

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

Test adds checks lede shows in the first place and confirms it works when the field is removed.

However it needs the cache clear, so I'll create a follow-up issue about the caching of the block (guessing it wants cache metadata, rather than just cache tags).

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

@ekes ekes left a comment

Choose a reason for hiding this comment

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

Approved because the test proves it. But don't merge till there's a follow-up linked. Follow-up posted.

@finnlewis finnlewis merged commit 2892462 into 2.x May 6, 2025
15 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PageHeaderSubscriber.php assumes a guide page will always have a body field

4 participants