The module offers a centralized configuration interface for managing revision requirements across various entity types. Administrators can specify which block types, content types, and taxonomy vocabularies are required to create new revisions when edited. Additionally, they can choose to require revision log messages for these entities. The module tracks and records all edits to blocks, nodes, and terms, ensuring transparency throughout the content workflow.

This module is an enhanced version of the Require Revision Log Message. It not only makes nodes require revision, but it also has the option to apply to Blocks and Taxonomy Terms.

Project link

https://www.drupal.org/project/require_revision

Comments

haklo created an issue. See original summary.

vishal.kadam’s picture

Title: Require Revision - 1.0.2 [D10], [D11] » [1.0.x] Require Revision
Component: feature » module
Issue summary: View changes
avpaderno’s picture

Issue summary: View changes

Thank you for applying!

Please read Review process for security advisory coverage: What to expect for more details and Security advisory coverage application checklist to understand what reviewers look for. Tips for ensuring a smooth review gives some hints for a smoother review.

The important notes are the following.

  • New releases are not necessary for these applications, which could require changes that are not backward-compatible. Not creating new releases avoids any possible issue.
  • Please do not change the branch to review once reviews started, except in the case the used branch needs to be deleted.
  • If you have not done it yet, enable GitLab CI for the project, and fix what reported from the phpcs job. This help to fix most of what reviewers would report.
  • For the time this application is open, only your commits are allowed. No other people, including other maintainers/co-maintainers can make commits.
  • The purpose of this application is giving you a new drupal.org role that allows you to opt projects into security advisory coverage, either projects you already created, or projects you will create. The project status won't be changed by this application.
  • Nobody else will get the permission to opt projects into security advisory policy. If there are other maintainers/co-maintainers who will to get that permission, they need to apply with a different module.
  • We only accept an application per user. If you change your mind about the project to use for this application, or it is necessary to use a different project for the application, please update the issue summary with the link to the correct project and the issue title with the project name and the branch to review.

To the reviewers

Please read How to review security advisory coverage applications, Application workflow, What to cover in an application review, and Tools to use for reviews.

The important notes are the following.

  • It is preferable to wait for a Code Review Administrator before commenting on newly created applications. Code Review Administrators will do some preliminary checks that are necessary before any change on the project files is suggested.
  • Reviewers should show the output of a CLI tool only once per application. The configuration used for these tools needs to be the same configuration used by GitLab CI, stored in the GitLab Templates repository.
  • It may be best to have the applicant fix things before further review.

For new reviewers, I would also suggest to first read In which way the issue queue for coverage applications is different from other project queues.

vishal.kadam’s picture

Status: Needs review » Needs work

1. main is acceptable as branch name, but it is not yet fully supported on drupal.org. For the moment, it is better to avoid it.

2. FILE: require_revision.module

/**
 * @file
 * Primary module hooks for Require Revision module.
 *
 * Provides functionality to enforce revision creation and revision log messages
 * for configured entity types.
 */

Drupal does not have primary and secondary hooks. Instead of that, it is preferable to use the usual description: “Hook implementations for the [module name] module”, where [module name] is the name of the module given in its .info.yml file.

3. Fix the warnings/errors reported by PHP_CodeSniffer.

Note: I would suggest enabling GitLab CI for the project, follow the Drupal Association .gitlab-ci.yml template and fix the PHP_CodeSniffer errors/warnings it reports.

phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,info,txt,md,yml require_revision/

FILE: require_revision/require_revision.info.yml
--------------------------------------------------------------------------------
FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
--------------------------------------------------------------------------------
  1 | WARNING | [ ] Remove "version" from the info file, it will be added by drupal.org packaging automatically
 13 | ERROR   | [x] Expected 1 newline at end of file; 0 found
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

FILE: require_revision/require_revision.module
------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------
 138 | ERROR | [x] Expected 1 newline at end of file; 0 found
------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------

FILE: require_revision/README.md
-------------------------------------------------------------------------
FOUND 1 ERROR AND 26 WARNINGS AFFECTING 27 LINES
-------------------------------------------------------------------------
   3 | WARNING | [ ] Line exceeds 80 characters; contains 140 characters
  20 | WARNING | [ ] Line exceeds 80 characters; contains 340 characters
  25 | WARNING | [ ] Line exceeds 80 characters; contains 88 characters
  33 | WARNING | [ ] Line exceeds 80 characters; contains 95 characters
  34 | WARNING | [ ] Line exceeds 80 characters; contains 93 characters
  35 | WARNING | [ ] Line exceeds 80 characters; contains 106 characters
  36 | WARNING | [ ] Line exceeds 80 characters; contains 91 characters
  37 | WARNING | [ ] Line exceeds 80 characters; contains 93 characters
  38 | WARNING | [ ] Line exceeds 80 characters; contains 85 characters
  77 | WARNING | [ ] Line exceeds 80 characters; contains 87 characters
  82 | WARNING | [ ] Line exceeds 80 characters; contains 81 characters
  84 | WARNING | [ ] Line exceeds 80 characters; contains 88 characters
  88 | WARNING | [ ] Line exceeds 80 characters; contains 88 characters
  91 | WARNING | [ ] Line exceeds 80 characters; contains 84 characters
  92 | WARNING | [ ] Line exceeds 80 characters; contains 92 characters
  94 | WARNING | [ ] Line exceeds 80 characters; contains 83 characters
 103 | WARNING | [ ] Line exceeds 80 characters; contains 152 characters
 106 | WARNING | [ ] Line exceeds 80 characters; contains 104 characters
 109 | WARNING | [ ] Line exceeds 80 characters; contains 103 characters
 115 | WARNING | [ ] Line exceeds 80 characters; contains 109 characters
 116 | WARNING | [ ] Line exceeds 80 characters; contains 142 characters
 117 | WARNING | [ ] Line exceeds 80 characters; contains 113 characters
 121 | WARNING | [ ] Line exceeds 80 characters; contains 111 characters
 122 | WARNING | [ ] Line exceeds 80 characters; contains 110 characters
 132 | WARNING | [ ] Line exceeds 80 characters; contains 91 characters
 176 | WARNING | [ ] Line exceeds 80 characters; contains 158 characters
 209 | ERROR   | [x] Expected 1 newline at end of file; 0 found
-------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------

FILE: require_revision/config/schema/require_revision.schema.yml
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
 40 | ERROR | [x] Expected 1 newline at end of file; 0 found
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

FILE: require_revision/require_revision.permissions.yml
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
 4 | ERROR | [x] Expected 1 newline at end of file; 0 found
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

FILE: require_revision/tests/src/Functional/RequireRevisionSettingsFormTest.php
--------------------------------------------------------------------------------
FOUND 116 ERRORS AFFECTING 115 LINES
--------------------------------------------------------------------------------
   3 | ERROR | [x] Namespaced classes, interfaces and traits should not begin with a file doc comment
  20 | ERROR | [x] Opening brace should be on the same line as the declaration
  22 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
  25 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
  27 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
  30 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
  31 | ERROR | [x] Array indentation error, expected 6 spaces but found 4
  32 | ERROR | [x] Array indentation error, expected 6 spaces but found 4
  33 | ERROR | [x] Array indentation error, expected 6 spaces but found 4
  34 | ERROR | [x] Array indentation error, expected 6 spaces but found 4
  37 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
  42 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
  44 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
  47 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
  48 | ERROR | [x] Opening brace should be on the same line as the declaration
  49 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
  51 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
  52 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
  54 | ERROR | [x] Array indentation error, expected 14 spaces but found 12
  55 | ERROR | [x] Array indentation error, expected 14 spaces but found 12
  56 | ERROR | [x] Array indentation error, expected 14 spaces but found 12
  57 | ERROR | [x] Array indentation error, expected 14 spaces but found 12
  60 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
  62 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
  65 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
  66 | ERROR | [x] Opening brace should be on the same line as the declaration
  67 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
  68 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
  69 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
  71 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
  72 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
  73 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
  74 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
  75 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
  76 | ERROR | [x] Object operator not indented correctly; expected 10 spaces but found 12
  77 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
  79 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
  82 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
  83 | ERROR | [x] Opening brace should be on the same line as the declaration
  84 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
  85 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
  87 | ERROR | [x] Array indentation error, expected 14 spaces but found 12
  88 | ERROR | [x] Array indentation error, expected 14 spaces but found 12
  92 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
  93 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
  95 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
  96 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
  98 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
  99 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
 101 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
 102 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
 103 | ERROR | [x] Array indentation error, expected 10 spaces but found 8
 103 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
 105 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
 107 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
 108 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
 109 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
 110 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
 111 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
 112 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
 114 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
 117 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
 118 | ERROR | [x] Opening brace should be on the same line as the declaration
 119 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
 120 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
 122 | ERROR | [x] Array indentation error, expected 14 spaces but found 12
 123 | ERROR | [x] Array indentation error, expected 14 spaces but found 12
 127 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
 128 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
 129 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
 131 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
 132 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
 134 | ERROR | [x] Array indentation error, expected 14 spaces but found 12
 135 | ERROR | [x] Array indentation error, expected 14 spaces but found 12
 138 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
 140 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
 141 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
 143 | ERROR | [x] Array indentation error, expected 14 spaces but found 12
 144 | ERROR | [x] Array indentation error, expected 14 spaces but found 12
 148 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
 149 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
 151 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
 152 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
 153 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
 154 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
 155 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
 156 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
 158 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
 161 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
 162 | ERROR | [x] Opening brace should be on the same line as the declaration
 163 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
 164 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
 166 | ERROR | [x] Array indentation error, expected 14 spaces but found 12
 167 | ERROR | [x] Array indentation error, expected 14 spaces but found 12
 171 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
 172 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
 173 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
 174 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
 176 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
 177 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
 179 | ERROR | [x] Array indentation error, expected 14 spaces but found 12
 180 | ERROR | [x] Array indentation error, expected 14 spaces but found 12
 183 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
 185 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
 186 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
 188 | ERROR | [x] Array indentation error, expected 14 spaces but found 12
 189 | ERROR | [x] Array indentation error, expected 14 spaces but found 12
 193 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
 194 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
 196 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
 197 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
 198 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
 202 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
 203 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
 204 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
 206 | ERROR | [x] Expected 1 newline at end of file; 0 found
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 116 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

FILE: require_revision/src/Form/RequireRevisionSettingsForm.php
--------------------------------------------------------------------------------
FOUND 156 ERRORS AND 3 WARNINGS AFFECTING 153 LINES
--------------------------------------------------------------------------------
   3 | ERROR   | [x] Namespaced classes, interfaces and traits should not begin with a file doc comment
  23 | ERROR   | [x] Opening brace should be on the same line as the declaration
  25 | ERROR   | [x] Line indented incorrectly; expected 2 spaces, found 4
  30 | ERROR   | [x] Line indented incorrectly; expected 2 spaces, found 4
  32 | ERROR   | [x] Line indented incorrectly; expected 2 spaces, found 4
  38 | ERROR   | [x] Line indented incorrectly; expected 2 spaces, found 4
  39 | ERROR   | [x] Opening brace should be on the same line as the declaration
  40 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 8
  41 | ERROR   | [x] Line indented incorrectly; expected 2 spaces, found 4
  43 | ERROR   | [x] Line indented incorrectly; expected 2 spaces, found 4
  46 | ERROR   | [x] Line indented incorrectly; expected 2 spaces, found 4
  47 | ERROR   | [x] Opening brace should be on the same line as the declaration
  48 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 8
  51 | ERROR   | [x] Line indented incorrectly; expected 2 spaces, found 4
  53 | ERROR   | [x] Line indented incorrectly; expected 2 spaces, found 4
  56 | ERROR   | [x] Line indented incorrectly; expected 2 spaces, found 4
  57 | ERROR   | [x] Opening brace should be on the same line as the declaration
  58 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 8
  59 | ERROR   | [x] Line indented incorrectly; expected 2 spaces, found 4
  61 | ERROR   | [x] Line indented incorrectly; expected 2 spaces, found 4
  64 | ERROR   | [x] Line indented incorrectly; expected 2 spaces, found 4
  65 | ERROR   | [x] Opening brace should be on the same line as the declaration
  66 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 8
  67 | ERROR   | [x] Line indented incorrectly; expected 2 spaces, found 4
  69 | ERROR   | [x] Line indented incorrectly; expected 2 spaces, found 4
  72 | ERROR   | [x] Line indented incorrectly; expected 2 spaces, found 4
  73 | ERROR   | [x] Opening brace should be on the same line as the declaration
  74 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 8
  76 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 8
  77 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 8
  78 | ERROR   | [x] Object operator not indented correctly; expected 10 spaces but found 12
  80 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 8
  81 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 8
  82 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 12
  83 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 8
  85 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 8
  86 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 8
  87 | ERROR   | [x] Object operator not indented correctly; expected 10 spaces but found 12
  89 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 8
  90 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 8
  91 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 12
  92 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 8
  94 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 8
  95 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 8
  96 | ERROR   | [x] Object operator not indented correctly; expected 10 spaces but found 12
  98 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 8
  99 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 8
 100 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 12
 101 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 8
 103 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 8
 104 | ERROR   | [x] Array indentation error, expected 10 spaces but found 8
 105 | WARNING | [ ] Translatable strings must not begin or end with white spaces, use placeholders with t() for variables
 106 | ERROR   | [ ] Concatenating translatable strings is not allowed, use placeholders instead and only one string literal
 107 | ERROR   | [x] Array indentation error, expected 10 spaces but found 8
 108 | ERROR   | [x] Array indentation error, expected 10 spaces but found 8
 111 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 8
 112 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 8
 113 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 12
 114 | ERROR   | [x] Array indentation error, expected 14 spaces but found 12
 115 | ERROR   | [x] Array indentation error, expected 14 spaces but found 12
 116 | ERROR   | [x] Array indentation error, expected 14 spaces but found 12
 116 | ERROR   | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
 118 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 12
 124 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 8
 126 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 8
 127 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 8
 128 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 12
 129 | ERROR   | [x] Array indentation error, expected 14 spaces but found 12
 130 | ERROR   | [x] Array indentation error, expected 14 spaces but found 12
 131 | ERROR   | [x] Array indentation error, expected 14 spaces but found 12
 131 | ERROR   | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
 133 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 12
 139 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 8
 141 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 8
 142 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 8
 143 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 12
 144 | ERROR   | [x] Array indentation error, expected 14 spaces but found 12
 145 | ERROR   | [x] Array indentation error, expected 14 spaces but found 12
 146 | ERROR   | [x] Array indentation error, expected 14 spaces but found 12
 146 | ERROR   | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
 148 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 12
 154 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 8
 156 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 8
 160 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 12
 161 | ERROR   | [x] Array indentation error, expected 14 spaces but found 12
 163 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 8
 163 | ERROR   | [x] Expected newline after closing brace
 164 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 12
 165 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 12
 166 | ERROR   | [x] Array indentation error, expected 14 spaces but found 12
 167 | ERROR   | [x] Array indentation error, expected 14 spaces but found 12
 168 | ERROR   | [x] Array indentation error, expected 14 spaces but found 12
 171 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 12
 172 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 12
 173 | ERROR   | [x] Array indentation error, expected 14 spaces but found 12
 175 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 8
 177 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 8
 178 | ERROR   | [x] Line indented incorrectly; expected 2 spaces, found 4
 180 | ERROR   | [x] Line indented incorrectly; expected 2 spaces, found 4
 183 | ERROR   | [x] Expected 1 spaces after parameter type; 31 found
 185 | ERROR   | [x] Expected 1 spaces after parameter type; 30 found
 187 | ERROR   | [x] Expected 1 spaces after parameter type; 31 found
 192 | ERROR   | [x] Line indented incorrectly; expected 2 spaces, found 4
 193 | ERROR   | [x] Multi-line function declaration not indented correctly; expected 6 spaces but found 8
 194 | ERROR   | [x] Multi-line function declaration not indented correctly; expected 6 spaces but found 8
 195 | ERROR   | [x] Multi-line function declaration not indented correctly; expected 6 spaces but found 8
 196 | ERROR   | [x] Multi-line function declaration not indented correctly; expected 6 spaces but found 8
 196 | ERROR   | [x] Multi-line function declarations must have a trailing comma after the last parameter
 198 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 8
 199 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 8
 200 | ERROR   | [x] Array indentation error, expected 10 spaces but found 8
 201 | ERROR   | [x] Array indentation error, expected 10 spaces but found 8
 202 | ERROR   | [x] Array indentation error, expected 10 spaces but found 8
 205 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 8
 206 | ERROR   | [x] Array indentation error, expected 10 spaces but found 8
 207 | ERROR   | [x] Array indentation error, expected 10 spaces but found 8
 208 | ERROR   | [x] Array indentation error, expected 10 spaces but found 8
 209 | WARNING | [ ] Translatable strings must not begin or end with white spaces, use placeholders with t() for variables
 210 | ERROR   | [ ] Concatenating translatable strings is not allowed, use placeholders instead and only one string literal
 211 | ERROR   | [x] Array indentation error, expected 10 spaces but found 8
 212 | ERROR   | [x] Array indentation error, expected 10 spaces but found 8
 213 | ERROR   | [x] Array indentation error, expected 10 spaces but found 8
 214 | ERROR   | [x] Array indentation error, expected 12 spaces but found 8
 217 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 8
 218 | ERROR   | [x] Array indentation error, expected 10 spaces but found 8
 219 | ERROR   | [x] Array indentation error, expected 10 spaces but found 8
 220 | ERROR   | [x] Array indentation error, expected 10 spaces but found 8
 221 | WARNING | [ ] Translatable strings must not begin or end with white spaces, use placeholders with t() for variables
 222 | ERROR   | [ ] Concatenating translatable strings is not allowed, use placeholders instead and only one string literal
 224 | ERROR   | [x] Array indentation error, expected 10 spaces but found 8
 225 | ERROR   | [x] Array indentation error, expected 10 spaces but found 8
 226 | ERROR   | [x] Array indentation error, expected 10 spaces but found 8
 227 | ERROR   | [x] Array indentation error, expected 12 spaces but found 8
 230 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 8
 231 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 8
 232 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 12
 233 | ERROR   | [x] Array indentation error, expected 14 spaces but found 12
 234 | ERROR   | [x] Array indentation error, expected 14 spaces but found 12
 235 | ERROR   | [x] Array indentation error, expected 14 spaces but found 12
 235 | ERROR   | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
 238 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 8
 239 | ERROR   | [x] Line indented incorrectly; expected 2 spaces, found 4
 241 | ERROR   | [x] Line indented incorrectly; expected 2 spaces, found 4
 244 | ERROR   | [x] Line indented incorrectly; expected 2 spaces, found 4
 245 | ERROR   | [x] Opening brace should be on the same line as the declaration
 246 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 8
 248 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 8
 249 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 8
 250 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 12
 251 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 12
 254 | ERROR   | [x] Line indented incorrectly; expected 2 spaces, found 12
 256 | ERROR   | [x] Line indented incorrectly; expected 2 spaces, found 12
 257 | ERROR   | [x] Line indented incorrectly; expected 2 spaces, found 12
 260 | ERROR   | [x] Line indented incorrectly; expected 2 spaces, found 12
 264 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 8
 266 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 8
 267 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 8
 268 | ERROR   | [x] Line indented incorrectly; expected 2 spaces, found 4
 270 | ERROR   | [x] Expected 1 newline at end of file; 0 found
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 153 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

FILE: require_revision/require_revision.libraries.yml
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
 8 | ERROR | [x] Expected 1 newline at end of file; 0 found
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

FILE: require_revision/require_revision.links.menu.yml
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
 6 | ERROR | [x] Expected 1 newline at end of file; 0 found
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

FILE: require_revision/require_revision.routing.yml
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
 7 | ERROR | [x] Expected 1 newline at end of file; 0 found
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------
haklo’s picture

@vishal.kadam, Thanks for the feedback!

haklo’s picture

Status: Needs work » Needs review
Issue tags: +phpcs

I've made the following updates:

✅ Fixed all phpcs coding standards violations
✅ Removed version field from .info.yml
✅ Enabled GitLab CI with automated testing
✅ All CI jobs passing: https://git.drupalcode.org/project/require_revision/-/pipelines

The latest code is available in the 1.0.x branch. Please let me know if there's anything else that needs attention.

avpaderno’s picture

Issue tags: -phpcs
vishal.kadam’s picture

Status: Needs review » Needs work

FILE: src/Form/RequireRevisionSettingsForm.php

ConfigFormBase::__construct() needs to be called. Since its parameters changed in Drupal 10.2, the project cannot be compatible with all the Drupal 10 releases and Drupal 11; it needs to require at least Drupal 10.2.

With Drupal 10 and Drupal 11, there is no longer need to use #default_value for each form element, when the parent class is ConfigFormBase: It is sufficient to use #config_target, as in the following code.

    $form['image_toolkit'] = [
      '#type' => 'radios',
      '#title' => $this->t('Select an image processing toolkit'),
      '#config_target' => 'system.image:toolkit',
      '#options' => [],
    ];

Using that code, it is no longer needed to save the configuration values in the form submission handler: The parent class will take care of that.

haklo’s picture

Status: Needs work » Needs review

Thanks for the detailed feedback! I've implemented all the requested changes:

✅ Updated to require Drupal 10.2+ (core_version_requirement: ^10.2 || ^11)
✅ Added ConfigFactoryInterface to constructor and called parent::__construct()
✅ Updated create() method to inject config.factory service
✅ Replaced manual config handling with #config_target for automatic saving
✅ Removed submitForm() method (parent class handles it automatically)

The form now uses modern Drupal 10.2+ patterns as recommended. GitLab CI pipeline passing with zero errors:
https://git.drupalcode.org/project/require_revision/-/pipelines

vishal.kadam’s picture

Status: Needs review » Needs work

FILE: src/Form/RequireRevisionSettingsForm.php

parent::__construct($config_factory);

ConfigFormBase::__construct() requires two parameters. See the change record.

haklo’s picture

Status: Needs work » Needs review

Thank you for catching that! I've now added the TypedConfigManagerInterface parameter.

✅ Added TypedConfigManagerInterface import
✅ Updated the constructor with both required parameters
✅ Called parent::__construct() with both parameters
✅ Injected config.typed service in create() method

vishal.kadam’s picture

Status: Needs review » Needs work

1. FILE: composer.json

  "require": {
    "drupal/core": "^10 || ^11"
  },

require_revision.info.yml

core_version_requirement: ^10.2 || ^11

Update drupal core requirement in composer file as per info file.

2. FILE: require_revision.module

For a new module that aims to be compatible with Drupal 10/11, it is expected it implements hooks as class methods as described in Support for object oriented hook implementations using autowired services.

3. FILE: src/Form/RequireRevisionSettingsForm.php

    $form['revision_required_' . $entity_type] = [
      '#type' => 'checkboxes',
      '#title' => $this->t('Requiring revisions'),
      '#description' => $this->t('Select the types that should require a new revision to be created when edited.'),
      '#options' => $options,
      '#config_target' => 'require_revision.settings:revision_required_' . $entity_type,
      '#default_value' => $config->get('revision_required_' . $entity_type) ?? [],
    ];

    $form['revision_log_required_' . $entity_type] = [
      '#type' => 'checkboxes',
      '#title' => $this->t('Requiring revision log messages'),
      '#description' => $this->t('Select the types that should require a revision log message. This only applies when the type is also set to require revisions above.'),
      '#options' => $options,
      '#config_target' => 'require_revision.settings:revision_log_required_' . $entity_type,
      '#default_value' => $config->get('revision_log_required_' . $entity_type) ?? [],
    ];

It is sufficient to use #config_target. There is no longer need to use #default_value.

  /**
   * The entity type manager.
   *
   * @var \Drupal\Core\Entity\EntityTypeManagerInterface
   */
  protected $entityTypeManager;

  /**
   * Constructs a RequireRevisionSettingsForm object.
   *
   * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
   *   The config factory service.
   * @param \Drupal\Core\Config\TypedConfigManagerInterface $typed_config
   *   The typed config manager service.
   * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager
   *   The entity type manager service.
   */
  public function __construct(ConfigFactoryInterface $config_factory, TypedConfigManagerInterface $typed_config, EntityTypeManagerInterface $entity_type_manager) {
    parent::__construct($config_factory, $typed_config);
    $this->entityTypeManager = $entity_type_manager;
  }

New modules, which are compatible with Drupal 10 and higher versions are expected to use constructor property promotion.

avpaderno’s picture

As a side note, it is not necessary to add the Drupal core requirements in the composer.json file: The Drupal.org Composer Façade will add them.

haklo’s picture

Status: Needs work » Needs review

Thanks for all the feedback. I've addressed everything:

✅ OOP hook architecture with service class and dependency injection
✅ Constructor property promotion in all classes
✅ Updated to require Drupal ^10.2 || ^11 in composer.json
✅ Removed #default_value
✅ Bridge pattern for hook delegation
✅ All phpcs violations fixed

Pipeline passing:
https://git.drupalcode.org/project/require_revision/-/pipelines/648041

Ready for review!

haklo’s picture

Here is a brief update following my change to "Needs Review."

✅ Added config/install/require_revision.settings.yml with default empty arrays
✅ Config keys now exist on installation, preventing null value errors
✅ #config_target now works correctly for both loading and saving

The install config ensures configuration keys are never null, so the form loads properly using only #config_target.

https://git.drupalcode.org/project/require_revision/-/pipelines/648079

vishal.kadam’s picture

Status: Needs review » Needs work

1. FILE: require_revision.module

/**
 * Implements hook_form_alter().
 */
function require_revision_form_alter(&$form, FormStateInterface $form_state, $form_id) {
  \Drupal::service('require_revision.hooks')->formAlter($form, $form_state, $form_id);
}
/**
 * Implements hook_entity_presave().
 */
function require_revision_entity_presave(EntityInterface $entity) {
  \Drupal::service('require_revision.hooks')->entityPresave($entity);
}

Procedural hooks should be marked with the #[LegacyHook] attribute.

2. FILE: src/Hook/RequireRevisionHooks.php

  /**
   * Implements hook_form_alter().
   */
  public function formAlter(&$form, FormStateInterface $form_state, $form_id): void {
  /**
   * Implements hook_entity_presave().
   */
  public function entityPresave(EntityInterface $entity): void {

The hook method must have a #[Hook()] attribute.

haklo’s picture

Status: Needs work » Needs review

Thanks for the clarification. I've added the hook attributes:

✅ #[Hook] attributes in RequireRevisionHooks class
✅ #[LegacyHook] attributes in .module file
✅ hook_subscriber tag in services

Pipeline passing and fully tested. Thank you for all your guidance.

vishal.kadam’s picture

Status: Needs review » Reviewed & tested by the community

Rest looks good to me.

Please wait for a Project Moderator to take a look and if everything goes fine, you will get the role.

avpaderno’s picture

Thank you for your contribution and for your patience with the review process!

I am going to update your account so you can opt into security advisory coverage any project you create, including the projects you already created.

These are some recommended readings to help you with maintainership:

You can find more contributors chatting on Slack or IRC in #drupal-contribute. So, come hang out and stay involved!
Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.

I thank also all the reviewers for helping with these applications.

avpaderno’s picture

Assigned: Unassigned » avpaderno
Status: Reviewed & tested by the community » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

haklo’s picture

Hi @vishal.kadam and @avpaderno,

Do you know why the Require Revision module page isn't displaying the "Works with Drupal:" and "Install:" information in the "Releases" section?

avpaderno’s picture

@haklo You created a distribution project, not a module project; I think distributions do not show that information.

avpaderno’s picture

You can ask to change the project type, by creating an issue like #3549996: Convert Distribution to Module Project - Crux, in that issue queue.

haklo’s picture

Thank you, @avpaderno.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.