Repository navigation
fix(academy): show the Revision Needs Work column on the content board - #1077
Merged
Merged
Conversation
Statuses Pro defines revision-needs-work as an alternate status and never clears the flag, whatever its position in the revision workflow. The Content Board skips alternate statuses, so revisions in that status never appeared. Clear the flag on copies of the status objects passed to the board.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Revisions set to Revision Needs Work never appear on the PublishPress Content Board, for any user. With revisions shown, the column is missing. Filtering by that status leaves every visible column empty.
Cause
Statuses Pro's default definition of
revision-needs-worksetsalternate => true(publishpress-statuses-pro/includes-pro/Revisions.php). When Statuses classifies statuses by position, it can set that flag but only ever clears it for Draft. So the status stays alternate even when it sits in the main revision workflow, as it does on production. Moving it on the Statuses screen doesn't change this.The Content Board skips alternate statuses when it builds its columns (
content-board.php,if (!empty($post_status_object->alternate)) continue;).Fix
A new mu-plugin,
cbf-content-board-revision-needs-work.php, hookspublishpress_calendar_post_statuses. On the Content Board page only, it replaces therevision-needs-workstatus with a copy that hasalternatecleared. Statuses caches the original objects and uses them for the workflow, so the originals stay unchanged and the workflow isn't affected.Testing
Tested locally against a copy of the production database, on the Content Board with revisions shown:
phpcs passes.