Updated: Comment #0

Problem/Motivation

CommentManager/CommentManagerInterface is getting too large, tell-tale sign is the number of dependencies.

Proposed resolution

Split the viewmode/output/links/render stuff from the entity/field-ui stuff

Remaining tasks

Patch

User interface changes

None

API changes

CommentManagerInterface split into two interfaces.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

andypost’s picture

andypost’s picture

Status: Active » Needs review
Related issues: -#2182055: Comment module causes Circular reference error on a REST request
FileSize
17.15 KB

Patch moves forbiddenMessage() method to CommentHelperInterface
Also removed dependency on current user service according #2182055: Comment module causes Circular reference error on a REST request

PS: getParentEntityUri() should be removed in #2245001: Remove unneeded CommentManagerInterface::getParentEntityUri()

andypost’s picture

FileSize
16.06 KB

re-roll

larowlan’s picture

Status: Needs review » Reviewed & tested by the community

Unless bot disagrees

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 3: 2188287-cm-split-3.patch, failed testing.

andypost’s picture

Status: Needs work » Needs review

3: 2188287-cm-split-3.patch queued for re-testing.

andypost’s picture

Status: Needs review » Reviewed & tested by the community
xjm’s picture

Status: Reviewed & tested by the community » Needs review

Can we pretty please come up with a more meaningful name than CommentHelper?

Also, can you check whether there are any existing change records that would need updates for this?

dawehner’s picture

Maybe simply CommentRenderHelper or CommentRender

andypost’s picture

OTOH this helper service just renders t(some text) so having a service for that looks overkill.
Previously there was a theme function for that but we move this to manager service...

The only reason to have the service for that piece of render is a caching of access rights, but I have no idea how to implement that properly

+++ b/core/modules/comment/lib/Drupal/comment/CommentHelper.php
@@ -0,0 +1,124 @@
+      $this->authenticatedCanPostComments = $this->entityManager

this class variable a kind of static cache that is not cleared

andypost’s picture

In #2247779: Allow #pre_render, #post_render and #post_render_cache callbacks to be service methods proposed CommentPostRenderCache with comment.post_render_cache definition

andypost’s picture

andypost’s picture

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

Let's rename to CommentRenderHelper, that's precisely describes the purpose

mrjmd’s picture

Assigned: Unassigned » mrjmd

Going to give this a try.

mrjmd queued 3: 2188287-cm-split-3.patch for re-testing.

The last submitted patch, 3: 2188287-cm-split-3.patch, failed testing.

mrjmd’s picture

Assigned: mrjmd » Unassigned
Issue tags: -Novice +needs re-roll

This need a reroll that's more complex than I can take on at the moment... several conflicts need to be resolved.

andypost’s picture

Also it would be great to move comment_preview() to the service

tim.plunkett’s picture

Issue tags: -needs re-roll +Needs reroll
andypost’s picture

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Caralin’s picture

Version: 8.4.x-dev » 8.5.x-dev
Issue tags: +Vienna2017
FileSize
22.44 KB
6.55 KB

changing the version to 8.5.x-dev

re-rolled the patch from #3 against 8.5.x

adding patch and interdiff

this needs more cleanup work!

jofitz’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll

Setting to Needs Review to run the testbot to help review the progress of this patch.

Removed Needs Reroll tag.

Status: Needs review » Needs work

The last submitted patch, 26: 2188287-cm-split-26.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.0-alpha1 will be released the week of January 17, 2018, which means new developments and disruptive changes should now be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

andypost’s picture

Version: 8.9.x-dev » 9.0.x-dev
Issue tags: +Needs reroll
shubham.prakash’s picture

Status: Needs work » Needs review
FileSize
22.1 KB

Added Reroll.

Status: Needs review » Needs work

The last submitted patch, 34: 2188287-34.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

vaibhavjain’s picture

Issue tags: -Needs reroll +Needs tests

Removing tag Reroll, as this patch applies cleanly to 9.0.x branch.
Added tag Needs tests, as it is failing tests.

swatichouhan012’s picture

Status: Needs work » Needs review
FileSize
22.1 KB
11.52 KB

updated patch to fix "non-existent service "entity.manager" Test fail, kindly review new patch file.

Status: Needs review » Needs work

The last submitted patch, 37: 2188287-37.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

hash6’s picture

Assigned: Unassigned » hash6
kishor_kolekar’s picture

Assigned: hash6 » kishor_kolekar
kishor_kolekar’s picture

Status: Needs work » Needs review
FileSize
24.46 KB
11.01 KB

kindly review new patch.

kishor_kolekar’s picture

Assigned: kishor_kolekar » Unassigned

Status: Needs review » Needs work

The last submitted patch, 41: 2188287-cm-split-41.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

kishor_kolekar’s picture

hi @andypost I have updated the following changes

  • CommentManager changed to CommentBuilder
  • CommentHelper changed to CommentFieldManager
  • forbiddenMessage method has been moved to CommentFieldManager(changed the interface)
  • Test cases needs to be updated. For now only, Unit Test for CommentBuilder has been updated under CommentBuilderTest.php

please review the new patch .

Status: Needs review » Needs work

The last submitted patch, 44: 2188287-cm-split-44.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

xjm’s picture

Version: 9.0.x-dev » 9.1.x-dev

This would be a minor-only change. Since 8.9.x and 9.0.x are now in beta, I'm moving this to 9.1.x. Thanks!

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.