Problem/Motivation
If the comment module is disabled we get this error.
Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException: You have requested a non-existent service "comment.manager". Did you mean one of these: "theme.manager", "config.manager"? in Drupal\Component\DependencyInjection\Container->get() (line 153 of xxx\core\lib\Drupal\Component\DependencyInjection\Container.php).
Proposed resolution
The rate module should not require a comment.
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | rate-rate_module_should_not_require_a_comment-3144824-9.patch | 18.43 KB | jordik |
| #4 | Screen Capture_select-area_20200614114439.png | 94.04 KB | hkirsman |
Comments
Comment #2
krzysztof domańskiComment #3
jordik commentedIt actually should require the comment module in tests, since we allow rating of comments in this version (as in D7 rate).
In rate.module we call the comment.manager service, so we have to check in both cases, whether the comment module is enabled.
Or make it a requirement for rate, as alternative.
Comment #4
hkirsman commentedI found the service being used in 2 places. Also fixed some coding standards issues and removed the big if's (better readability).
I'm wondering if we should hide the comments options from admin if the module is disabled?
Comment #5
hkirsman commentedComment #6
hkirsman commentedComment #7
jordik commentedThank you for this patch!
I would not hide the checkbox column, disabling it would be probably a better option.
In this way, if any entities were configured for comments, they will be visible (but not used).
And we should check if the comment module is enabled also when enabling the modules for tests in /tests/src/Functional/RateWidgetTestBase.php
Comment #8
jordik commentedUpdated the patch to disable the Comments column in the widget list and edit form.
In case the comment module is not installed, the column header in both forms will appear as "Comments (disabled)" and the checkboxes in the column will be disabled.
Fixed some coding standard issues.
Comment #9
jordik commentedComment #11
jordik commented