Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Neslee Canil Pinto created an issue. See original summary.

Neslee Canil Pinto’s picture

Status: Active » Needs review
FileSize
14.9 KB
cilefen’s picture

Issue tags: +Documentation
Kristen Pol’s picture

Assigned: Unassigned » Kristen Pol

I'll take a look.

Kristen Pol’s picture

Title: Add @inheritdoc inside flower brackets » Add @inheritdoc inside curly brackets
Kristen Pol’s picture

Title: Add @inheritdoc inside curly brackets » Add missing curly brackets around @inheritdoc
Issue summary: View changes
Status: Needs review » Reviewed & tested by the community

Thanks for the patch. I've reviewed as follows:

1) Found all files that had the missing curly brackets using grep (see list below).

2) Applied patch which applied cleanly.

3) Re-checked the files with the missing curly brackets using grep and the remaining files are:

  • vendor/laminas/laminas-feed/src/Reader/Entry/Rss.php
  • vendor/laminas/laminas-feed/src/Reader/Entry/Atom.php
  • vendor/psr/log/Psr/Log/Test/TestLogger.php

but laminas and psr are 3rd party libraries so nothing can be done with those.

4) Reviewed the patch and it seems fine.

5) Did not do any manual testing since I'm not sure how it can be tested.

Marking RTBC. Thanks!

List of files without curly brackets for "@inheritdoc" before applying patch:

  • core/modules/migrate_drupal/src/Annotation/MigrateField.php
  • core/modules/jsonapi/tests/src/Kernel/Revisions/VersionNegotiatorTest.php
  • core/modules/contextual/js/toolbar/views/AuralView.es6.js
  • core/modules/contextual/js/toolbar/views/VisualView.es6.js
  • core/modules/contextual/js/views/AuralView.es6.js
  • core/modules/contextual/js/views/VisualView.es6.js
  • core/modules/contextual/js/views/RegionView.es6.js
  • core/modules/quickedit/js/editors/plainTextEditor.es6.js
  • core/modules/quickedit/js/editors/formEditor.es6.js
  • core/modules/quickedit/js/models/FieldModel.es6.js
  • core/modules/quickedit/js/models/EntityModel.es6.js
  • core/modules/quickedit/js/views/FieldDecorationView.es6.js
  • core/modules/quickedit/js/views/EditorView.es6.js
  • core/modules/quickedit/js/views/FieldToolbarView.es6.js
  • core/modules/quickedit/js/views/EntityDecorationView.es6.js
  • core/modules/quickedit/js/views/EntityToolbarView.es6.js
  • core/modules/toolbar/js/models/ToolbarModel.es6.js
  • core/modules/toolbar/js/views/BodyVisualView.es6.js
  • core/modules/toolbar/js/views/ToolbarVisualView.es6.js
  • core/modules/toolbar/js/views/MenuVisualView.es6.js
  • core/modules/ckeditor/js/views/KeyboardView.es6.js
  • core/modules/image/js/editors/image.es6.js
  • core/modules/migrate/tests/src/Unit/process/UrlEncodeTest.php
  • core/modules/migrate/src/Plugin/migrate/id_map/Sql.php
  • core/modules/path_alias/tests/src/Functional/Rest/PathAliasResourceTestBase.php
  • core/modules/tour/js/tour.es6.js
  • core/modules/editor/js/editor.formattedTextEditor.es6.js
  • vendor/laminas/laminas-feed/src/Reader/Entry/Rss.php
  • vendor/laminas/laminas-feed/src/Reader/Entry/Atom.php
  • vendor/psr/log/Psr/Log/Test/TestLogger.php
Kristen Pol’s picture

Assigned: Kristen Pol » Unassigned
Suresh Prabhu Parkala’s picture

#2 patch got failed to apply. This is the new patch.

Kristen Pol’s picture

It would be good to include an interdiff file and explain the changes made.

Kristen Pol’s picture

Status: Reviewed & tested by the community » Needs work

Both patches applied cleanly for me, but the first patch applied "more cleanly" and the patch in #8 removed some code for fixing editor.formattedTextEditor.es6.js that was in the patch from #2 so moving this back to "Needs work" though the patch from #2 is ok.

@Suresh Prabhu Parkala It would be good to know what were your issues. We shouldn't add more patches if there isn't a need. Thanks.

[mac:kristen:drupal-9.0.x-dev]$ patch -p1 < 3126957-2.patch 
patching file core/modules/ckeditor/js/views/KeyboardView.es6.js
patching file core/modules/contextual/js/toolbar/views/AuralView.es6.js
patching file core/modules/contextual/js/toolbar/views/VisualView.es6.js
patching file core/modules/contextual/js/views/AuralView.es6.js
patching file core/modules/contextual/js/views/RegionView.es6.js
patching file core/modules/contextual/js/views/VisualView.es6.js
patching file core/modules/editor/js/editor.formattedTextEditor.es6.js
patching file core/modules/image/js/editors/image.es6.js
patching file core/modules/jsonapi/tests/src/Kernel/Revisions/VersionNegotiatorTest.php
patching file core/modules/migrate/src/Plugin/migrate/id_map/Sql.php
patching file core/modules/migrate/tests/src/Unit/process/UrlEncodeTest.php
patching file core/modules/migrate_drupal/src/Annotation/MigrateField.php
patching file core/modules/path_alias/tests/src/Functional/Rest/PathAliasResourceTestBase.php
patching file core/modules/quickedit/js/editors/formEditor.es6.js
patching file core/modules/quickedit/js/editors/plainTextEditor.es6.js
patching file core/modules/quickedit/js/models/EntityModel.es6.js
patching file core/modules/quickedit/js/models/FieldModel.es6.js
patching file core/modules/quickedit/js/views/EditorView.es6.js
patching file core/modules/quickedit/js/views/EntityDecorationView.es6.js
patching file core/modules/quickedit/js/views/EntityToolbarView.es6.js
patching file core/modules/quickedit/js/views/FieldDecorationView.es6.js
patching file core/modules/quickedit/js/views/FieldToolbarView.es6.js
patching file core/modules/toolbar/js/models/ToolbarModel.es6.js
patching file core/modules/toolbar/js/views/BodyVisualView.es6.js
patching file core/modules/toolbar/js/views/MenuVisualView.es6.js
patching file core/modules/toolbar/js/views/ToolbarVisualView.es6.js
patching file core/modules/tour/js/tour.es6.js
[mac:kristen:drupal-9.0.x-dev]$ patch -p1 < 3126957-8.patch
patching file core/modules/ckeditor/js/views/KeyboardView.es6.js
patching file core/modules/contextual/js/toolbar/views/AuralView.es6.js
patching file core/modules/contextual/js/toolbar/views/VisualView.es6.js
patching file core/modules/contextual/js/views/AuralView.es6.js
patching file core/modules/contextual/js/views/RegionView.es6.js
patching file core/modules/contextual/js/views/VisualView.es6.js
patching file core/modules/image/js/editors/image.es6.js
patching file core/modules/jsonapi/tests/src/Kernel/Revisions/VersionNegotiatorTest.php
Hunk #1 succeeded at 67 with fuzz 2.
patching file core/modules/migrate/src/Plugin/migrate/id_map/Sql.php
patching file core/modules/migrate/tests/src/Unit/process/UrlEncodeTest.php
patching file core/modules/migrate_drupal/src/Annotation/MigrateField.php
patching file core/modules/path_alias/tests/src/Functional/Rest/PathAliasResourceTestBase.php
patching file core/modules/quickedit/js/editors/formEditor.es6.js
patching file core/modules/quickedit/js/editors/plainTextEditor.es6.js
patching file core/modules/quickedit/js/models/EntityModel.es6.js
patching file core/modules/quickedit/js/models/FieldModel.es6.js
patching file core/modules/quickedit/js/views/EditorView.es6.js
patching file core/modules/quickedit/js/views/EntityDecorationView.es6.js
patching file core/modules/quickedit/js/views/EntityToolbarView.es6.js
patching file core/modules/quickedit/js/views/FieldDecorationView.es6.js
patching file core/modules/quickedit/js/views/FieldToolbarView.es6.js
patching file core/modules/toolbar/js/models/ToolbarModel.es6.js
patching file core/modules/toolbar/js/views/BodyVisualView.es6.js
patching file core/modules/toolbar/js/views/MenuVisualView.es6.js
patching file core/modules/toolbar/js/views/ToolbarVisualView.es6.js
patching file core/modules/tour/js/tour.es6.js
Kristen Pol’s picture

Ah, I see the failed patch applying message now in #2.

Patch Failed to Apply - View results on dispatcher

error: patch failed: core/modules/jsonapi/tests/src/Kernel/Revisions/VersionNegotiatorTest.php:69
error: core/modules/jsonapi/tests/src/Kernel/Revisions/VersionNegotiatorTest.php: patch does not apply

so the patch from #8 just needs to be updated to include editor.formattedTextEditor.es6.js as noted in #10.

Suresh Prabhu Parkala’s picture

Status: Needs work » Needs review
FileSize
14.85 KB

Updated patch. Please review!

Kristen Pol’s picture

Assigned: Unassigned » Kristen Pol
Kristen Pol’s picture

Assigned: Kristen Pol » Unassigned
Status: Needs review » Needs work

Thanks for the update.

@Suresh Prabhu Parkala It's good to add an interdiff when making incremental changes https://www.drupal.org/documentation/git/interdiff.

1) Compared patches from #8 and #12 and the only difference was the addition of core/modules/editor/js/editor.formattedTextEditor.es6.js.

2) Patch applies cleanly:

[mac:kristen:drupal-9.0.x-dev]$ patch -p1 < 3126957-12.patch
patching file core/modules/ckeditor/js/views/KeyboardView.es6.js
patching file core/modules/contextual/js/toolbar/views/AuralView.es6.js
patching file core/modules/contextual/js/toolbar/views/VisualView.es6.js
patching file core/modules/contextual/js/views/AuralView.es6.js
patching file core/modules/contextual/js/views/RegionView.es6.js
patching file core/modules/contextual/js/views/VisualView.es6.js
patching file core/modules/editor/js/editor.formattedTextEditor.es6.js
patching file core/modules/image/js/editors/image.es6.js
patching file core/modules/jsonapi/tests/src/Kernel/Revisions/VersionNegotiatorTest.php
patching file core/modules/migrate/src/Plugin/migrate/id_map/Sql.php
patching file core/modules/migrate/tests/src/Unit/process/UrlEncodeTest.php
patching file core/modules/migrate_drupal/src/Annotation/MigrateField.php
patching file core/modules/path_alias/tests/src/Functional/Rest/PathAliasResourceTestBase.php
patching file core/modules/quickedit/js/editors/formEditor.es6.js
patching file core/modules/quickedit/js/editors/plainTextEditor.es6.js
patching file core/modules/quickedit/js/models/EntityModel.es6.js
patching file core/modules/quickedit/js/models/FieldModel.es6.js
patching file core/modules/quickedit/js/views/EditorView.es6.js
patching file core/modules/quickedit/js/views/EntityDecorationView.es6.js
patching file core/modules/quickedit/js/views/EntityToolbarView.es6.js
patching file core/modules/quickedit/js/views/FieldDecorationView.es6.js
patching file core/modules/quickedit/js/views/FieldToolbarView.es6.js
patching file core/modules/toolbar/js/models/ToolbarModel.es6.js
patching file core/modules/toolbar/js/views/BodyVisualView.es6.js
patching file core/modules/toolbar/js/views/MenuVisualView.es6.js
patching file core/modules/toolbar/js/views/ToolbarVisualView.es6.js
patching file core/modules/tour/js/tour.es6.js

3) Searched the 9.0 dev codebase after applying the patch and there are no more references to * @inheritdoc.

4) Compared the patch in #2 to #12 and noticed:


+++ b/core/modules/jsonapi/tests/src/Kernel/Revisions/VersionNegotiatorTest.php
@@ -67,9 +67,7 @@ class VersionNegotiatorTest extends JsonapiKernelTestBase {
   /**
-   * Initialization tasks for the test.
-   *
-   * @inheritdoc
+   * {@inheritDoc}

but this is correct based on:

https://www.drupal.org/docs/develop/standards/api-documentation-and-comm...

This must be the only line in the docblock.

Technically, it shouldn't be fixed in this issue unless we update the issue summary to include this. Then we should look for others with the same problem. I think it would be difficult to search for more of these. IMO, it's ok to fix this one for now.

5) Did a quick scan of the code and inheritDoc is used instead of inheritdoc (note the casing) for:

  • +++ b/core/modules/jsonapi/tests/src/Kernel/Revisions/VersionNegotiatorTest.php
    @@ -67,9 +67,7 @@ class VersionNegotiatorTest extends JsonapiKernelTestBase {
    -   * Initialization tasks for the test.
    -   *
    -   * @inheritdoc
    +   * {@inheritDoc}
    
  • +++ b/core/modules/migrate/src/Plugin/migrate/id_map/Sql.php
    @@ -905,7 +905,7 @@ public function currentDestination() {
       /**
    -   * @inheritdoc
    +   * {@inheritDoc}
    
  • +++ b/core/modules/migrate/tests/src/Unit/process/UrlEncodeTest.php
    @@ -14,7 +14,7 @@
       /**
    -   * @inheritdoc
    +   * {@inheritDoc}
    
  • +++ b/core/modules/migrate_drupal/src/Annotation/MigrateField.php
    @@ -20,7 +20,7 @@
       /**
    -   * @inheritdoc
    +   * {@inheritDoc}
    
  • +++ b/core/modules/path_alias/tests/src/Functional/Rest/PathAliasResourceTestBase.php
    @@ -22,7 +22,7 @@
       /**
    -   * @inheritdoc
    +   * {@inheritDoc}
    

6) Marking back to "Needs work" for #5.

Kristen Pol’s picture

Note, I found a discussion about the inheritdoc vs inheritDoc at #3060580: Allow inheritdoc and inheritDoc?. For now, it still should be all lowercase but that might change later.

Suresh Prabhu Parkala’s picture

Status: Needs work » Needs review
FileSize
14.85 KB
2.22 KB

Updated patch. Please review.

Kristen Pol’s picture

Status: Needs review » Reviewed & tested by the community

Thanks for the update.

1) Confirmed changes are just the inheritDoc => inheritdoc.

2) Patch applies cleanly:

[mac:kristen:drupal-9.0.x-dev]$ patch -p1 < 3126957-16.patch
patching file core/modules/ckeditor/js/views/KeyboardView.es6.js
patching file core/modules/contextual/js/toolbar/views/AuralView.es6.js
patching file core/modules/contextual/js/toolbar/views/VisualView.es6.js
patching file core/modules/contextual/js/views/AuralView.es6.js
patching file core/modules/contextual/js/views/RegionView.es6.js
patching file core/modules/contextual/js/views/VisualView.es6.js
patching file core/modules/editor/js/editor.formattedTextEditor.es6.js
patching file core/modules/image/js/editors/image.es6.js
patching file core/modules/jsonapi/tests/src/Kernel/Revisions/VersionNegotiatorTest.php
patching file core/modules/migrate/src/Plugin/migrate/id_map/Sql.php
patching file core/modules/migrate/tests/src/Unit/process/UrlEncodeTest.php
patching file core/modules/migrate_drupal/src/Annotation/MigrateField.php
patching file core/modules/path_alias/tests/src/Functional/Rest/PathAliasResourceTestBase.php
patching file core/modules/quickedit/js/editors/formEditor.es6.js
patching file core/modules/quickedit/js/editors/plainTextEditor.es6.js
patching file core/modules/quickedit/js/models/EntityModel.es6.js
patching file core/modules/quickedit/js/models/FieldModel.es6.js
patching file core/modules/quickedit/js/views/EditorView.es6.js
patching file core/modules/quickedit/js/views/EntityDecorationView.es6.js
patching file core/modules/quickedit/js/views/EntityToolbarView.es6.js
patching file core/modules/quickedit/js/views/FieldDecorationView.es6.js
patching file core/modules/quickedit/js/views/FieldToolbarView.es6.js
patching file core/modules/toolbar/js/models/ToolbarModel.es6.js
patching file core/modules/toolbar/js/views/BodyVisualView.es6.js
patching file core/modules/toolbar/js/views/MenuVisualView.es6.js
patching file core/modules/toolbar/js/views/ToolbarVisualView.es6.js
patching file core/modules/tour/js/tour.es6.js

3) There are other inheritDoc (note case) after applying the patch but they aren't related to this issue.

  • ./core/lib/Drupal/Core/Entity/EntityAutocompleteMatcher.php: * {@inheritDoc}
  • ./core/lib/Drupal/Component/Annotation/Doctrine/SimpleAnnotationReader.php: * {@inheritDoc}
  • ./core/modules/workspaces/src/EventSubscriber/WorkspaceRequestSubscriber.php: * {@inheritDoc}

4) Marking RTBC based on this and previous reviews.

jungle’s picture

In addition to #17

The patch made changes to .es6.js files, in general, the corresponding .js files should be generated by running commands below

$ cd core
$ yarn
$ yarn build:js # or yarn run build:js

I did run it once, confirmed that no changes to .js files, as changes are made to comments, whilst comments are stripped out while building

xjm’s picture

Issue tags: +Needs followup

Nice work on this!

There are a few other @inheritdoc that are wrong in different ways. I found them by running:

[ibnsina:maintainer | Wed 17:39:32] $ grep -r "@inheritdoc" * | grep -v "node_modules" | grep -v "vendor" | grep -v "~" | grep -v "{@inheritdoc}"
core/lib/Drupal/Core/Field/FieldConfigBase.php:   * [@inheritdoc}
core/lib/Drupal/Core/ProxyBuilder/ProxyBuilder.php:   * {@inheritdoc{
Binary file core/modules/jsonapi/tests/src/Functional/MenuLinkContentTest.php matches
core/modules/field/tests/modules/field_test/src/Form/NestedEntityTestForm.php:   * {@inheritdoc]
core/modules/field/tests/modules/field_test/src/Form/NestedEntityTestForm.php:   * {@inheritdoc]
core/modules/field/tests/modules/field_test/src/Form/NestedEntityTestForm.php:   * {@inheritdoc]
core/modules/content_translation/src/Plugin/Validation/Constraint/ContentTranslationSynchronizedFieldsConstraintValidator.php:   * [@inheritdoc}
core/modules/rest/src/Entity/RestResourceConfig.php:   * (@inheritdoc)

Can someone create a single followup issue to fix those?

xjm’s picture

Saving issue credit.

  • xjm committed 9ea59d2 on 9.1.x
    Issue #3126957 by Suresh Prabhu Parkala, Neslee Canil Pinto, Kristen Pol...

  • xjm committed 9a0a338 on 9.0.x
    Issue #3126957 by Suresh Prabhu Parkala, Neslee Canil Pinto, Kristen Pol...
xjm’s picture

Version: 9.0.x-dev » 8.8.x-dev
Status: Reviewed & tested by the community » Patch (to be ported)

I reviewed the patch with git diff --color-words to verify that only changes to add the curly braces are included. There's one place where we're deleting a redundant one-line summary along with correcting it to {@inheritdoc}, but since the patch is just 15K I'll let it slide to include that as well.

...Goodness does it take a bit to run the yarn run checks on all those files...

Committed to 9.1.x and 9.0.x. Thanks!

The patch doesn't apply to 8.9.x, so I think we'll want a new patch for 8.9.x and probably 8.8.x. Marking as Patch to be ported for those backports.

jungle’s picture

Status: Patch (to be ported) » Reviewed & tested by the community
FileSize
14.91 KB
930 bytes

@xjm, thanks for committing!

Just did reroll the patch for 8.9.x from #16, and tested on my local that it's applied successfully to 8.8.x, with the minimal change without fixing #19, and with the raw-interdiff, I am setting back to RTBC. This should not be counted as self-RTBC :p.

jungle’s picture

Follow-up issue filed for #19

jungle’s picture

From the output @xjm posted in #19

Binary file core/modules/jsonapi/tests/src/Functional/MenuLinkContentTest.php matches

We need to be careful to generate the new patch in the follow-up as MenuLinkContentTest.php is a binary file recognized. Mentioned it on the follow-up too.

#3126906: MenuLinkContentTest.php is recognized as a binary file by git is the ongoing issue related to it. Comments to there are welcome. Thanks!

jungle’s picture

BTW. patch uploaded to the follow-up #3132287: Fix wrong usages of {@inheritdoc}, and testings against 8.8.x, 8.9.x, 9.0.x and 9.1.x passed. RTBC is expected if applicable. Thanks!

  • xjm committed cc7365b on 8.9.x
    Issue #3126957 by Suresh Prabhu Parkala, jungle, Neslee Canil Pinto,...

  • xjm committed 7dccd66 on 8.8.x
    Issue #3126957 by Suresh Prabhu Parkala, jungle, Neslee Canil Pinto,...
xjm’s picture

Status: Reviewed & tested by the community » Fixed

Committed the backports to 8.9.x and 8.8.x. Thanks @jungle!

Status: Fixed » Closed (fixed)

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