Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When I enable facets module the whole site is getting down with an error:
Uncaught PHP Exception Symfony\\Component\\DependencyInjection\\Exception\\ServiceNotFoundException: "You have requested a non-existent service "search_api.query_helper"." at /var/www/user640/data/www/example.com/web/core/lib/Drupal/Component/DependencyInjection/Container.php line 157, referer: http://example.com/batch?id=20&op=start
I uninstall facets with drush pm-unistall, enable search_api module, then enable facets - everything works, no errors.
Comment | File | Size | Author |
---|---|---|---|
#13 | module_depends_on_a-2877989-13.patch | 3.13 KB | borisson_ |
Comments
Comment #2
borisson_See also #2878792: You have requested a non-existent service "search_api.query_helper". in Drupal\Component\DependencyInjection\Container->get()
Comment #3
borisson_I think this is also why the tests are currently all failing on HEAD. Let's try to get to this with priority!
Comment #4
borisson_I'm afraid that the easiest answer will be to create a new submodule that depends on search api.
Either that or something like this in the ::create method of \Drupal\facets\Plugin\facets\facet_source\SearchApiDisplay
Let's get opinions in before we do this, tagging as beta blocker - because if we need to create the submodule, we really have to do that before beta.
Comment #5
StryKaizerI prefer a moduleExists for this case
I think most users will use facets with search_api enabled, so I don't mind having this in the core facets module.
Comment #6
borisson_Added this as a patch; with more docs.
Comment #7
borisson_Updated the title.
Comment #8
Rishi KulshreshthaPatch got applied pretty well on the latest dev version of the module but somehow after enabling it I'm getting this message:
Fatal error: Call to undefined method stdClass::isRenderedInCurrentRequest() in /var/www/drupal/modules/contrib/facets/facets.module on line 249
This is the code in
facets.module
on line 249:if (!$facet_source_plugin->isRenderedInCurrentRequest()) {
Comment #9
Rishi KulshreshthaComment #10
borisson_Ah, great catch. I figured this should work, but looks like we'll have to do more work to actually get this to work. I'll try to get to this issue over the weekend.
Comment #11
borisson_I think this resolves the problem. Would you mind testing this?
Comment #13
borisson_Fixes the tests, not related to this issue.
Comment #14
Rishi KulshreshthaPatch provided in [#13] got easily applied to the latest dev version of the module.
I was able to enable this module without any dependency of
search_api
, hence marking this as RTBC.Comment #16
borisson_Committed, thanks!