Problem/Motivation
When taxonomy terms were converted to be revisionable in #2880149: Convert taxonomy terms to be revisionable we disabled Content Moderation integration because the UI was not ready yet.
Proposed resolution
After #2899923: UI for publishing/unpublishing taxonomy terms lands, we should re-enable CM integration.
Remaining tasks
None.
User interface changes
In a workflow's configuration screen (e.g editorial worklflow), users now have the option to apply the workflow to taxonomies.
Once that's done the state field becomes available on the taxonomy term add and edit screens so users can moderate the vocabulary's taxonomy terms.
API changes
Nope.
Data model changes
Nope.
Release notes snippet
Nope.
Comment | File | Size | Author |
---|---|---|---|
#77 | moderated-taxonomy-term.png | 74.01 KB | pavlosdan |
#77 | add-workflow-to-tags.png | 28.73 KB | pavlosdan |
#68 | 3047110-nr-bot.txt | 90 bytes | needs-review-queue-bot |
#58 | stg_content-moderation_unpublish-state-error.gif | 6.29 MB | miserable_full-stack_developer |
#56 | link_to_moderated_content.png | 177.51 KB | kreynen |
Issue fork drupal-3047110
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
amateescu CreditAttribution: amateescu for Pfizer, Inc. commentedHere's the initial work needed here. Not sending to the testbot since it needs #2899923: UI for publishing/unpublishing taxonomy terms first.
Comment #4
Manuel Garcia CreditAttribution: Manuel Garcia as a volunteer and at Appnovation for Pfizer, Inc. commentedHouse cleaning, just postponing on #2899923: UI for publishing/unpublishing taxonomy terms
Comment #5
timmillwoodGuess we can open this back up now.
Comment #6
Manuel Garcia CreditAttribution: Manuel Garcia as a volunteer and at Appnovation for Pfizer, Inc. commentedBlocking issue is in so yes. Triggered the tests on the initial patch just to see where we are with this.
Comment #7
andypostreroll for taxonomy.module hunk
Comment #9
n4r3nComment #10
yogeshmpawarSetting back to Needs Review & Triggering bots.
@n4r3n - can you please post the interdiff as well?
Comment #11
Manuel Garcia CreditAttribution: Manuel Garcia as a volunteer and at Appnovation for Pfizer, Inc. commentedNits / CS review.
These arrays should be one item in each line.
let's cache this as
$assert_session = $this->assertSession();
Comment #13
Manuel Garcia CreditAttribution: Manuel Garcia as a volunteer and at Appnovation for Pfizer, Inc. commentedSince we're checking here that parents were changed, should we do assertNotEqual() instead?
Also, should we uncomment
//$this->assertSession()->pageTextNotContains($validation_message);
?Comment #15
t3kn0ph34r CreditAttribution: t3kn0ph34r commentedWith #2899923: UI for publishing/unpublishing taxonomy terms being closed, is this back under active consideration/development?
Comment #16
Manuel Garcia CreditAttribution: Manuel Garcia as a volunteer and at Appnovation for Pfizer, Inc. commentedRe #15 yes indeed, we are free to work on this now.
Latest patch #9 needed a reroll, so here's a first step forward.
Comment #18
Manuel Garcia CreditAttribution: Manuel Garcia as a volunteer and at Appnovation for Pfizer, Inc. commentedThe failing test on #16 is because the test is trying to change the parent before publishing the taxonomy term, I have changed the test to first publish the term, then change the parent. Please let me know if this is not correct and the failure is valid and there is a bug, to me it seems reasonable but I could be wrong.
The rest of changes are essentially tidying things up and addressing my comments earlier on #11 and #13.
Comment #19
timmillwoodComment #21
amateescu CreditAttribution: amateescu as a volunteer commentedI think the failure from #16 is genuine, because it should be possible to change the parent of a term _at the same time_ when the term is being published.
The underlying problem is probably somewhere in Content Moderation, because
$entity->isDefaultRevision()
should return TRUE in an entity validator constraint, if the entity that is about to be saved *will be* a default revision.Also found this small bug while looking into it :) #3134704: Remove stray debug leftover in TaxonomyTermHierarchyConstraintValidator
Comment #22
dmitry.korhovTried patch with JSON:API export and it does not work.
$resource_type->isVersionable()
returns false. So draft and published versions of terms are not exposed with JSON:APIComment #25
ArtusamakSurprisingly, #16 still works with 9.1.9!
Yet i'm wondering how to manage the content moderation view that is only applying to nodes. Though, it's probably out of this issue's scope.
Thanks!
Comment #26
greggmarshallComposer reports patch #18 fails to apply on 9.2.0.
Actually the best I can tell section of the patch modifying the taxonomy.module by deleting the .function taxonomy_entity_type_alter isn't needed any more since that bit of code seems to have been deleted in 9.2.0 in issue #3204883: Move exclusion of taxonomy terms from moderation to content_moderation module.
Comment #27
hugronaphor CreditAttribution: hugronaphor at Acrosto for University of Dundee commentedRe-roll the patch while taking into account the changes in #3204883: Move exclusion of taxonomy terms from moderation to content_moderation module.
Content moderation still works with this
Comment #28
hugronaphor CreditAttribution: hugronaphor at Acrosto for University of Dundee commentedAdded missing TaxonomyTermContentModerationTest.php
Comment #29
dhirendra.mishra CreditAttribution: dhirendra.mishra at Valuebound for Valuebound commentedFixed the coding standards issue from previous patch..
Comment #30
dhirendra.mishra CreditAttribution: dhirendra.mishra at Valuebound for Valuebound commentedComment #32
vsujeetkumar CreditAttribution: vsujeetkumar at Material for Drupal India Association commentedFixed fail tests, It is related to:
- "drupalPostForm()" & "taxonomy_term_load_multiple_by_name()" are deprecated,
- "void return",
- "$modules" property must be declared protected.
Comment #34
kreynen CreditAttribution: kreynen commentedWe've been testing this including building out Views as part of a custom moderation UI. Everything was working really well until we ran into #3145661: Users without "administer taxonomy" permission can't see unpublished terms canonical pages. Granting full access to administer taxonomy to users in the role we created to review new terms is problematic for us. In our use case, mistakenly deleting a term would cause a lot of problems.
We're evaluating the time involved in adding custom validation to prevent this, but Content Moderation of Taxonomy Terms still has limitations when compared to moderating Content Types.
Comment #35
kreynen CreditAttribution: kreynen commentedAnother feature missing from really being able to leverage Content Moderation on Taxonomy is the Most Recent Revision filter in Views. That was rewritten in #2865579: Rewrite the 'Latest revision' views filter and remove the revision_tracker table. It's not clear to me what would need to be done to include support for that filter in the Taxonomy Revision Views, but it is difficult to leverage moderation state without it.
Comment #38
jurgenhaasI've applied and tested patch from #32 on Drupal 9.5.2 and it works just great.
Comment #39
quietone CreditAttribution: quietone at PreviousNext commented@jurgenhaas, thanks for reporting that the patch is working for you and the version of Drupal it is being used on.
The Issue Summary is clear.
Going through the comments I see that the following have not been addressed
I skimmed the patch and noticed the following items.
This looks to be out of scope.
It would be easier to follow if parent_1 was used here. The same applies to other comments. As in 'change the parent to parent_2' and so on.
Why is this commented out?
I saw an @todo in the code for this issue. A search of core needs to be done to check for all instances and determine if the todo can be deleted.
Comment #40
jurgenhaasOh sorry for that @quietone - as the issue was NR I thought that all that had been addressed. Will be more cautious next time.
Comment #41
kreynen CreditAttribution: kreynen at University of Colorado commentedI can't see how this could get merged without resolving #3145661: Users without "administer taxonomy" permission can't see unpublished terms canonical pages. The expectation of enabling Content Moderation on Taxonomy Terms is going to be that the responsibility could be assigned to the same roles as other types of content. Requiring Administer Taxonomy for this seems wrong.
Not sure if the lack of a View filter would get resolved here or in a follow-up issue, but this is another place where it won't work the way most people expect.
Comment #45
swirtPosting a patch from the last MR push because I need an immutable patch.
Comment #46
RajeshreeputraComment #47
smustgrave CreditAttribution: smustgrave at Mobomo commentedFrom what I can tell points in #39 have not been addressed.
Which also mentions other comments not addressed.
Comment #49
slydevil CreditAttribution: slydevil commentedAdded permission check for view all revisions - @kreynen is correct.
Comment #50
slydevil CreditAttribution: slydevil commentedComment #51
slydevil CreditAttribution: slydevil commentedComment #52
RajeshreeputraOne thing noticed that once taxonomy term published and then moved to Draft, still the term is in published state.
Comment #53
ArtusamakIt's the same behavior for nodes.
Comment #54
kreynen CreditAttribution: kreynen at University of Colorado commentedYep. The draft version is "ahead" of the currently published version until it is published.
Comment #55
slydevil CreditAttribution: slydevil commentedI chose the Node permission "view all revisions" and this is definitely wrong. The issue https://www.drupal.org/project/drupal/issues/2936995 provides revision permissions and should probably be a blocker for this issue.
Comment #56
kreynen CreditAttribution: kreynen at University of Colorado commentedThe current MR solved my original issue, but our use case is only using moderation on a single vocabulary. I agree with @slydevil that it makes more sense to use view terms revisions in $id, but then we just get to the next place where the experience of managing drafts of terms doesn't have feature parity with content.
I added #3359159: Add Status to OverviewTerms.php form and proposed a patch to add Status to the Terms Overview UI. Unlike the Content Overview, admin/structure/taxonomy/manage/[tid[/overview is not a View and there is no support to filter terms by moderation state making it hard to add the UI users are used to seeing in Content.
I'm not sure if the goal is to make incremental progress on this in multiple issues or propose a single META MR that would provide the type of features users will expect to see when enabling moderation on a specific Vocabulary.
Comment #58
miserable_full-stack_developer CreditAttribution: miserable_full-stack_developer commentedWe have a project using 9.3.2, Acquia_CMS 1.4.0.
We added node type and/or taxonomy to a workflow item.
We tried enable_content_moderation_for_terms-3047110-49.patch.
We're using 3047110-32.patch to enable moderation for taxonomy_term.
We contacted Acquia Support.
We are failing at UNPUBLISHING either node or taxonomy_term.
Is anyone experience this issue and how to fix it?
I'm thinking that the feature can do this:
- User can specify a state as published.
- When user set the state, the feature will set entity.status to 1.
I'm thinking that the feature CAN NOT do this at the moment:
- User no need to specify states as unpublished.
- When user set a state other than the state-as-published, the feature won't set entity.status to 0.
If someone can help I'm willing to share what more needed detail.
It's been 1/2 year already.
Thanks in advance!
PS:
We're trying to upgrading to D9.4.15 (PHP 7.4) and ACMS 1.5.5 with hope to get the issue resolved but facing many issues while updating DB and importing configs.
- Our Staging environment is blocked by unknown validation when saving content. It's READ-ONLY mode now.
- We got dirty configuration in database.
- We 're facing getConfigDependencyName() on NULL while updating DB by scheduler_content_moderation_integration_update_9002()
Comment #59
kreynen CreditAttribution: kreynen at University of Colorado commentedWoot! #3359159: Add Status to OverviewTerms.php form was merged into core! Small step, but it improves the core UI when using this patch.
Comment #60
Manuel Garcia CreditAttribution: Manuel Garcia as a volunteer and commentedHey thanks for that, a good improvement indeed!
Comment #61
Manuel Garcia CreditAttribution: Manuel Garcia as a volunteer and commentedComment #62
acbramley CreditAttribution: acbramley at PreviousNext for Service NSW commentedAdding related revisions UI issue.
Comment #64
sakthi_dev CreditAttribution: sakthi_dev at Specbee for Drupal India Association commentedRerolled with 11.x.
Comment #65
pavlosdan CreditAttribution: pavlosdan at Acquia commentedSetting this back to needs review. The issues in #39, #47 seem to have been addressed except no1 in #39 which I don't think is out of scope since we need content moderation to be testing for taxonomy_term entity as well which may have a different entity key for label than other entities which may use "title".
Comment #66
needs-review-queue-bot CreditAttribution: needs-review-queue-bot as a volunteer commentedThe Needs Review Queue Bot tested this issue. It fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".
This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.
Comment #67
acbramley CreditAttribution: acbramley at PreviousNext for Service NSW commented@sakthi_dev please do not upload patches, this issue is using an MR and patches are confusing the bot.
Comment #68
needs-review-queue-bot CreditAttribution: needs-review-queue-bot as a volunteer commentedThe Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".
This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.
Comment #70
acbramley CreditAttribution: acbramley at PreviousNext for Service NSW commentedOh! The MR is still against 10.x. We either need it rebased against 11.x, or it's probably easier to create a new branch off 11.x and apply the changes (which seem like they're not applying cleanly according to the bot)
I've hidden the 9.5.x branch
Comment #72
pavlosdan CreditAttribution: pavlosdan at Acquia commentedCreated a new branch from 11.x and cherrypicked the commits onto it.
Comment #74
acbramley CreditAttribution: acbramley at PreviousNext for Service NSW commentedWe're missing a moderation handler here too, see BlockContentModerationHandler
Comment #75
pavlosdan CreditAttribution: pavlosdan at Acquia commentedComment #76
acbramley CreditAttribution: acbramley at PreviousNext for Service NSW commentedGreat work on the MR, I think now we just need an IS update and a CR.
Comment #77
pavlosdan CreditAttribution: pavlosdan at Acquia commentedChange record added https://www.drupal.org/node/3424780 and issue summary updated.
Comment #78
acbramley CreditAttribution: acbramley at PreviousNext for Service NSW commentedGreat job @pavlosdan, thank you for pushing this along - the only thing for me now is whether we have enough test coverage or not. CM is a huge layer of complexity, but the test coverage in the MR (along with existing test coverage that we're enabling for taxonomy terms) seems quite thorough.
I think we're good to go!
Comment #79
pavlosdan CreditAttribution: pavlosdan at Acquia commentedThank you for the reviews and suggestions @acbramley!
Comment #82
longwaveI think the test coverage is fine; the actual changes here are minimal and this functionality is already tested, we just need to ensure it's extended for this entity type which has been done here.
Committed and pushed 07473ef250 to 11.x and 2d61a0ef34 to 10.3.x. Thanks!