Updated: Comment #0


There's a CommentManager that could be overriden in contrib but without Interface definition
Also we need to inject the service to other services and controllers and it better to make via interface

Proposed resolution

Add interface

Related issues
#2097123: Deprecate comment_num_new() in favour of method on CommentManager

#4 interdiff.txt4.52 KBandypost
#4 drupal8.comment-module.2101155-4.patch11.33 KBandypost
PASSED: [[SimpleTest]]: [MySQL] 58,681 pass(es). View
#1 2101155-commentManagerInterface-1.patch6.8 KBandypost
PASSED: [[SimpleTest]]: [MySQL] 59,149 pass(es). View
Membership dollars fund testing for the Drupal project. Drupal Association Learn more


andypost’s picture

Status: Active » Needs review
6.8 KB
PASSED: [[SimpleTest]]: [MySQL] 59,149 pass(es). View

maybe change doc block of implementation to 'Provides comment manager service'?

larowlan’s picture

Will review today

larowlan’s picture

Status: Needs review » Reviewed & tested by the community
+++ b/core/modules/comment/lib/Drupal/comment/CommentManagerInterface.php
@@ -0,0 +1,87 @@
+  public function getParentEntityUri(CommentInterface $comment);

I still think this belongs on CommentInterface but thats for another issue.

andypost’s picture

11.33 KB
PASSED: [[SimpleTest]]: [MySQL] 58,681 pass(es). View
4.52 KB

Let's add actual usage

jibran’s picture

Awesome RTBC +1

larowlan’s picture

Thanks for cleaning up refs here, +1

webchick’s picture

Title: Add CommentManagerInterface » Change notice: Add CommentManagerInterface
Priority: Normal » Major
Status: Reviewed & tested by the community » Active
Issue tags: +Needs change record

Committed and pushed to 8.x. Thanks!

This needs a change notice.

andypost’s picture

Filed initial change notice https://drupal.org/node/2112417 suppose we should extend it latter when more functions would be approved to be converted to swappable implementation, for example #2111357: Get rid of comment_count_unpublished() in favor of CommentStorage method

PS: #3 addressed in #2111419: Remove CommentManager::getParentEntityUri() in favor of Comment::permalink()

larowlan’s picture

Priority: Major » Normal
Status: Active » Fixed
Issue tags: -Needs change record
jibran’s picture

Title: Change notice: Add CommentManagerInterface » Add CommentManagerInterface

Status: Fixed » Closed (fixed)

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

Anonymous’s picture

Issue summary: View changes