Sub-Issue of #1976158: Rename entity storage/list/form/render "controllers" to handlers.

Rename Drupal\content_translation\ContentTranslationController (not the other one in the Controller namespace!) to ContentTranslationHandler.

Then to do the same for all subclasses of this for Node, Term and so on.

This class is referenced in the entity annotations, so make sure to do a text search for the class name so that you find those references as well.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Berdir’s picture

pfrenssen’s picture

Assigned: Unassigned » pfrenssen
pfrenssen’s picture

Assigned: pfrenssen » Unassigned
Status: Active » Needs review
FileSize
74.91 KB

Renamed the classes. I grepped the codebase and it looks like all instances are covered, but I might have missed something. Let's see what the bot thinks of it.

Berdir’s picture

Status: Needs review » Needs work

Looks like the patch didn't pick up the renames, make sure to use -M or see https://drupal.org/documentation/git/configure about renames.

pfrenssen’s picture

Didn't know about that option, this is much easier to review! Only CommentTranslationHandler was not picked up, the file is so small that it probably exceeded a threshold for LoC changed to still be recognized as a rename.

pfrenssen’s picture

Status: Needs work » Needs review
Berdir’s picture

Status: Needs review » Needs work
  1. +++ b/core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockTranslationHandler.php
    @@ -33,7 +33,7 @@ public function entityFormAlter(array &$form, array &$form_state, EntityInterfac
       /**
    -   * Overrides ContentTranslationController::entityFormTitle().
    +   * Overrides ContentTranslationHandler::entityFormTitle().
    

    When touching those, let's convert to {@inheritdoc}.

  2. +++ b/core/modules/content_translation/lib/Drupal/content_translation/ContentTranslationHandler.php
    @@ -2,7 +2,7 @@
      * @file
    - * Definition of Drupal\content_translation\ContentTranslationController.
    + * Definition of Drupal\content_translation\ContentTranslationHandler.
    

    Same here, fix those by using Contains \Drupal... instead (note leading backslash)

pfrenssen’s picture

Assigned: Unassigned » pfrenssen

I'll take care of it.

pfrenssen’s picture

Status: Needs work » Needs review
FileSize
27.84 KB
11.3 KB
Berdir’s picture

+++ b/core/modules/content_translation/lib/Drupal/content_translation/ContentTranslationHandler.php
@@ -42,7 +42,7 @@ public function __construct(EntityTypeInterface $entity_type) {
 
   /**
-   * Implements ContentTranslationControllerInterface::retranslate().
+   * Implements ContentTranslationHandlerInterface::retranslate().
    */
   public function retranslate(EntityInterface $entity, $langcode = NULL) {

Still a few left in this file. Just the Implements, the Form validation/submission references are fine.

pfrenssen’s picture

Fixed those too.

plach’s picture

Status: Needs review » Reviewed & tested by the community

I completely agree with this rename (it matches how this stuff is called in D7 :) and the patch looks good!

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 11: 2227973-11.content_translation.controller_rename.patch, failed testing.

Berdir’s picture

Status: Needs work » Reviewed & tested by the community

git rebase took care of the re-roll, so back to RTBC.

alexpott’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs reroll

2227973-11.content_translation.controller_rename.patch no longer applies.

error: patch failed: core/modules/content_translation/lib/Drupal/content_translation/ContentTranslationController.php:12
error: core/modules/content_translation/lib/Drupal/content_translation/ContentTranslationController.php: patch does not apply

Berdir’s picture

Status: Needs work » Reviewed & tested by the community
Issue tags: -Needs reroll
FileSize
27.63 KB

Yeah, I failed to upload the re-roll it seems. Automatically done with git rebase, so back to RTBC.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed 3b3ba27 and pushed to 8.x. Thanks!

  • Commit 3b3ba27 on 8.x by alexpott:
    Issue #2227973 by pfrenssen, Berdir: Rename ContentTranslationController...
alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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