Problem/Motivation

DefaultFacetManagerTest seems to be failing since #3561530: Facets referencing entities checks access, which isn't always sensible or performant: https://git.drupalcode.org/project/facets/-/commits/3.0.x?ref_type=heads

Steps to reproduce

https://git.drupalcode.org/project/facets/-/jobs/8750738

Proposed resolution

This might be caused by https://www.drupal.org/node/3489270.
Tests now have to provide config for the body field if they need it: https://www.drupal.org/node/3223395#s-node-storage-body-field

Remaining tasks

User interface changes

API changes

Data model changes

Issue fork facets-3579256

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

prudloff created an issue. See original summary.

prudloff’s picture

Hum weirdly I can't reproduce the failure when running the test locally.

ericgsmith’s picture

@prudloff I initially thought the same, but then I realised I hadn't pulled in the latest search api changes locally..

Exception is being caught and rethrown here: https://git.drupalcode.org/project/search_api/-/commit/64403c2993dad8954...

Original source of exception seems to be when getFieldHandlerForProperty is called for the body field.

Quick debugging showed that
- facets_search_api_dependency is being installed, which has dependency on search_api_test_db which has a dependency on search_api_test_example_content
- search_api_test_example_content contains the body field in its config
- at the time the exception is thrown, when I inspect \Drupal::service('entity_field.manager')->getFieldMap()['entity_test_mulrev_changed'] I do not see the body field listed

Maybe something to do with config ordering?

I remember hitting this in an install profile in https://www.drupal.org/project/search_api/issues/3352150

To quote that issue:

the issue is that the index depends on the field storage not field instances, where the field instances are what is needed.

I have not confirmed that it is the same issue but I'm pretty sure it is related

Edit - my above instinct / assumption seems wrong, the config of the test index does depend on both the field storage and the field index so I dunno whats happening here https://git.drupalcode.org/project/search_api/-/blob/8.x-1.x/tests/modul...

ericgsmith’s picture

When first looking at it I overlooked this was a kernel test. Updating to make sure the config from search_api_test_example_content is installed too.

*edit* And its green 🎉

ericgsmith’s picture

Status: Active » Needs review
mkalkbrenner’s picture

Status: Needs review » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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