Auto-purging bug when Editor Role publishes a post #313
Comments
I can reproduce this also, thanks for the steps! |
A guess (and that's all it is at this point) is that |
I ran a couple of tests. It seems under this scenario that the first hook to Not sure why this is happening yet, or what we can do to fix it. Just sharing my findings. |
I see the default status is Since we have Possible Solution...I see that both of these hooks; i.e. Although, I suppose it is important for us to look at the post status before we do anything here. What I mean is, we really DO need to know what the status is (or is going to be) before we do anything here. Hmm. Maybe we could look for |
My last commit here should resolve the issue. I think it would be a good idea to create a second issue that references this one. Just something to remind us that in the future we should probably refactor the |
Thanks for fixing this, @jaswsinc! :) Pull Requests have been merged. |
Next release changelog:
|
@jaswsinc writes...
Hmm, I'm not really sure what would work best their either. What you have now (i.e., what you added to fix this issue) seems like all we really can do. Do you foresee a better way to optimize this? I'm just wondering if we should bother opening another issue to refactor |
What came to my mind the other day when I working on this, was that perhaps we could work on queuing these auto-purging routines instead of processing them in real-time; i.e. letting the hooks run as they do now, but instead of acting on these events, we hold-off until right before a script's shutdown phase; once WordPress is done with the tasks that it has been asked to do. I see a few advantages to this...
|
Ah, I see where you're going with this now. Thanks! Fantastic idea. I love the idea of a queuing system--that would solve a lot of the funky issues we have to deal with right now. I'll open a new issue for this so we can work on it. |
Bug Summary
When users with the Editor role publish new posts, the cache files for all associated archive views (e.g., categories and tags) may not be purged as expected. This only occurs when Publishing a post (Updating works fine) and when both a Category and a Tag are associated with the new post (if only a Category is associated, everything works as expected).
Steps to reproduce
/category/Uncategorized/
) and a tag archive view (e.g.,/tag/example/
) to generate a cache for those two pagesUncategorized
and Tagexample
); Note: you MUST assign both a Category and a Tag to reproduce this; see notes below./category/Uncategorized/
) and a tag archive view (e.g.,/tag/example/
). You'll see that both pages are loading the old cache file and have not been purged as they should have been when publishing a new post with that category and tag.Notes
The text was updated successfully, but these errors were encountered: