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.

Comments

Krzysztof Domański created an issue. See original summary.

krzysztof domański’s picture

Status: Active » Needs work
StatusFileSize
new414 bytes
jordik’s picture

It 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.

hkirsman’s picture

I 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 in admin

hkirsman’s picture

hkirsman’s picture

Status: Needs work » Needs review
jordik’s picture

Thank 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

jordik’s picture

StatusFileSize
new15.12 KB

Updated 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.

jordik’s picture

StatusFileSize
new18.43 KB

  • JordiK committed 600912a on 8.x-2.x
    Issue #3144824 by JordiK, hkirsman: The rate module should not require a...
jordik’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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