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

Query Loop Block: Sticky posts do not stay at the top when used in template #61785

Closed
thekingsprojects opened this issue Mar 10, 2022 · 11 comments
Labels
[Block] Query Loop Customer Report Issues or PRs that were reported via Happiness. Previously known as "Happiness Request". [Feature] Full Site Editor The site editor. [Pri] Normal Schedule for the next available opportuinity. Triaged To be used when issues have been triaged. [Type] Bug

Comments

@thekingsprojects
Copy link

thekingsprojects commented Mar 10, 2022

Quick summary

When using the Query Loop block to show posts as part of an FSE template (e.g., on the theme's "Index" template), any sticky posts appear in the normal post flow, rather than at the top/front of the post list.

This does not seem to happen when a Query Loop block is used within the content of a page; I've only been able to replicate it in a template so far.

Steps to reproduce

  1. Make a post sticky.
  2. If the sticky post would be the newest post, create another, non-sticky post that is newer.
  3. Open the Editor on an FSE-enabled site.
  4. Open a template that contains a Query Loop set to show posts, or add this block to a template.
  5. Make sure that the "Sticky posts" setting for the Query Loop is set to "Include", not Exclude or Only.

What you expected to happen

Any sticky posts should appear above other, more recent posts.

What actually happened

Posts appear in the normal newest-to-oldest sort order, ignoring any "sticky" settings.

Context

Customer report here: 4839669-zen

Confirmed by testing on my own Atomic site.

Possibly related to this issue? In this case, however, both the editor and the live site are ignoring the sticky setting, rather than the live site still functioning correctly.

Simple, Atomic or both?

No response

Theme-specific issue?

No response

Browser, operating system and other notes

No response

Reproducibility

Consistent

Severity

No response

Available workarounds?

Yes, easy to implement

Workaround details

Option 1: Add a second Query Loop above the first one. Set the "top" query loop to show Only sticky posts, while the "bottom" one Excludes sticky posts.

Option 2 (not applicable to every case, but was offered to this user): Write the desired text (in this case, an introduction) directly into the template, above the Query Loop, instead of relying on a sticky post.

@kimerlin81 kimerlin81 added [Pri] Normal Schedule for the next available opportuinity. [Feature] Full Site Editor The site editor. [Block] Query Loop Triaged To be used when issues have been triaged. labels Mar 11, 2022
@kimerlin81
Copy link

Thanks for submitting this bug report @thekingsprojects! I was able to reproduce this on a test site with several themes activated. I've added this report to the HE Cross-Reference Watchlist since there is a related issue in the Gutenberg Repo: WordPress/gutenberg#38979

@jamiepalatnik
Copy link

jamiepalatnik commented Mar 12, 2022

Another report: 4839596-zd-woothemes

Edit: Looks like this is a different report for the same user site.

@helenaartmann
Copy link

helenaartmann commented May 2, 2022

Another report: 5183244-zen

Gave them the two workarounds suggested above.

@kimerlin81
Copy link

Another report of this. Shared option 1 workaround

  • please update user in 5311021-zd-woothemes once this is fixed

@Trekky12
Copy link

Unfortunately the workaround option 1 is not usable since the sticky posts option is hidden when the query is inherit.
Is there another option to create two query loops with and without sticky posts?

@github-actions
Copy link

github-actions bot commented Dec 11, 2022

Support References

This comment is automatically generated. Please do not edit it.

  • 4839669-zen
  • 4839596-zen
  • 5183244-zen
  • 5311021-zen
  • 7448744-zen

@cuemarie
Copy link

Encountered this issue here: 7448744-zen

@github-actions github-actions bot added the Customer Report Issues or PRs that were reported via Happiness. Previously known as "Happiness Request". label Dec 13, 2023
@cuemarie
Copy link

Its unclear if this was fixed in core or not, based on WordPress/gutenberg#38979

@annezazu
Copy link

sticky.post.query.loop.mov

Definitely fixed :) Closing this out both due to no further reports and inability to replicate.

@lancewillett
Copy link
Contributor

Question for @cuemarie CC @tashabishop02 & @andrewspittle

Do we need reach back out to all the above "attached" customer reports in Zendesk (etc.) to close the loop after a fix?

Or, how would we handle getting the word out if someone had this issue?

Reading the comments on this ticket, there are a few that say, "Please update the customer when this is fixed." But, it's from 2022... so maybe we missed the window of opportunity.

@andrewspittle
Copy link

I'll defer to @tashabishop02 here on the decision. In an ideal world I think we follow up with people. But, as you note, that may require a more timely fix than we arrived at here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Query Loop Customer Report Issues or PRs that were reported via Happiness. Previously known as "Happiness Request". [Feature] Full Site Editor The site editor. [Pri] Normal Schedule for the next available opportuinity. Triaged To be used when issues have been triaged. [Type] Bug
Projects
None yet
Development

No branches or pull requests

9 participants