Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
Follow-up to #2725533: Add experimental content_moderation module. The module probably has missing test coverage. There are several @todo's in the code.
Proposed resolution
Identify missing test coverage and resolve the @todo's in sub issues.
Remaining tasks
Workflow
- core/modules/workflows/src/Form/WorkflowTransitionEditForm.php:93: // @todo https://www.drupal.org/node/2830584 Add some ajax to ensure that
- core/modules/workflows/src/Form/WorkflowTransitionAddForm.php:78: // @todo https://www.drupal.org/node/2830584 Add some ajax to ensure that
- core/modules/workflows/src/WorkflowTypeInterface.php:114: * @todo https://www.drupal.org/node/2579743 make part of a generic interface.
- core/modules/workflows/tests/modules/workflow_type_test/config/schema/workflow_type_test.schema.yml:27:# @todo, inline this straight into "workflow.type_settings.workflow_type_complex_test"
- core/modules/workflows/tests/src/Functional/Rest/WorkflowResourceTestBase.php:104: // @todo Update in https://www.drupal.org/node/2300677.
Content Moderation
core/modules/content_moderation/src/Plugin/Field/FieldWidget/ModerationStateWidget.php:114: // @todo https://www.drupal.org/node/2779933 write a test for this.core/modules/content_moderation/src/Entity/Handler/ModerationHandler.php:37: // @todo remove this when revision and translation issues have beencore/modules/content_moderation/src/ParamConverter/EntityRevisionConverter.php:32: * @todo: If the parent class is ever cleaned up to use EntityTypeManager- #2973493: Remove @todo in content_moderation related to NULL values of the moderation_state field.
core/modules/content_moderation/src/EntityTypeInfo.php:162: // @todo Core forgot to add a direct way to manipulate route_provider, so- #2973487: Add form #state to force "Default revision" on when "Published" is checked for a new moderation state
core/modules/content_moderation/tests/src/Kernel/ViewsDataIntegrationTest.php:160: // @todo I would have expected that the content_moderation_state default
User interface changes
None
API changes
None
Data model changes
None
Comments
Comment #4
timmillwoodAdding a grep of all @todos.
Comment #5
timmillwoodOne of the @todo's removed in #2753717: Add select field to choose moderation state on entity forms.
Comment #6
Sam152 CreditAttribution: Sam152 as a volunteer and at PreviousNext commentedOpened #2859455: Remove superfluous @todos from content moderation to deal with the ones that are simply outdated and can be wholesale removed.
Comment #7
Sam152 CreditAttribution: Sam152 as a volunteer and at PreviousNext commentedOpened #2861417: Correctly handle entity validation of the moderation_state field when trying to save invalid states. for "src/Plugin/Validation/Constraint/ModerationStateConstraintValidator.php:98: // @todo - what if $new_state references something that does not exist or..."
Comment #9
timmillwoodUpdating the list of @todo's in the issue summary based on the current version of the code.
I think very few of these relate to missing test coverage though.
Comment #10
timmillwoodGiving the @todos numbers
Comment #11
timmillwoodcontent_moderation.1 is the only one which mentions "write a test" and actually links to this issue, but wondering if we can remove that whole chunk of code, it's incredibly edge case. What is does is, if an entity has a field which has the class set to ModerationStateFieldItemList, and is not moderated, the field access is set to false, but why would a field have the class set to ModerationStateFieldItemList?
Comment #13
Sam152 CreditAttribution: Sam152 as a volunteer and at PreviousNext commentedUpdating the status of the CM list. Only 2 @todos left, both with patches.