[wp-trac] [WordPress Trac] #52007: sticky_posts somehow ends up with duplicate IDs and unstickying only removes one at a time
WordPress Trac
noreply at wordpress.org
Thu Dec 10 02:12:34 UTC 2020
#52007: sticky_posts somehow ends up with duplicate IDs and unstickying only
removes one at a time
-------------------------------+-----------------------------
Reporter: archon810 | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Posts, Post Types | Version: 5.5.3
Severity: normal | Keywords:
Focuses: |
-------------------------------+-----------------------------
Hi all,
Somehow we ran into this bug on production where the sticky_posts array
ended up with duplicate IDs that were stickied, and unstickying only
removed the same ID one at a time instead of all of them at once, so
unstickying kept the post stickied until it was unstickied enough times to
clear the array.
For example, this is how I found sticky_posts:
{{{
a:3:{i:1;i:744381;i:2;i:725382;i:3;i:725382;}
}}}
Note that 725382 is duplicated. Unstickying once did this:
{{{
a:2:{i:0;i:744381;i:1;i:725382;}
}}}
How we got to the duplicate ID state, I cannot say (perhaps that's a
separate bug), but solution here is to not exit the loop when the ID is
reached and removed and instead keep going till the end.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/52007>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list