Skip to content

Return only published entries from template lookups by anchor - #382

Open
snoopdave wants to merge 1 commit into
masterfrom
template-entry-lookup-published
Open

snoopdave wants to merge 1 commit into
masterfrom
template-entry-lookup-published

Conversation

@snoopdave

Copy link
Copy Markdown
Contributor

Master twin of #380: templates could read draft, pending and scheduled entries with getWeblogEntry(anchor), including on other weblogs reached through $site.

  • WeblogWrapper.getWeblogEntry(anchor) returns null unless the entry is published. No bundled theme calls it.
  • New WeblogWrapperEntryLookupTest. Full suite on JDK 25 (release 21): 908 tests, 0 failures.
  • CHANGES.md entry under 7.0.0 behaviour changes.

A custom template could read draft, pending and scheduled entries through
$weblog.getWeblogEntry(anchor), including on weblogs reached through $site.
Templates now get null for anything not published. No bundled theme uses
the call.

@mraible mraible left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good. The other entry lookups on the wrapper (recent entries, entries by tag, recent comments) already filter on published or approved status, so this was the only one that didn't.

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.

2 participants