Problem/Motivation

Installing the 'facets_demo' module currently fails on recent core versions with the following error:

Drupal\Core\Config\UnmetDependenciesException: Configuration objects provided by facets_demo have unmet dependencies: field.field.node.movie.body (field.storage.node.body)

This also causes 'FacetsDemoTest::testDemoPage' to fail, which is one of the three issues currently keeping the '3.0.x' branch pipeline red.

The root cause is that core moved the node body field storage out of the 'node' module. On Drupal 10, it shipped in 'core/modules/node/config/install/field.storage.node.body.yml', so simply installing 'node' created it. However, by Drupal 11.3, it lives only in the hidden, deprecated 'node_storage_body_field' submodule, and 'node_add_body_field()' is deprecated with no replacement.

Because 'facets_demo' ships with 'field.field.node.movie.body' and the demo search index relies on 'field.storage.node.body', the installation breaks since the storage is no longer automatically available.

Proposed resolution

I considered three possible routes to fix this, but the first two unfortunately do not work:

  • Depending on 'node_storage_body_field' is not an option (it is hidden, deprecated, and does not exist in Drupal 10, which this module still supports).
  • Shipping 'field.storage.node.body' directly from 'facets_demo' would throw a 'PreExistingConfigException' on any site that already has it installed.

This leaves us with two viable options:

  • Option A (Custom field): Give the demo its own namespaced field (e.g., 'field_movie_body') with its own storage. This would touch the field and storage config, the three entity form/view displays, the demo search index, and the 11 content fixtures.
  • Option B (Simpler): Drop the body field from the demo entirely, and just index the title and taxonomy fields.

I am more than happy to write the MR for either one — which approach would you prefer?

Remaining tasks

  1. Decide on the preferred approach (Option A or B).
  2. Implement the changes and review.

Issue fork facets-3618863

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

peri22 created an issue. See original summary.

peri22’s picture

Status: Active » Needs review

Since no preference came in, I went ahead with Option A, though I am still happy to redo it as Option B if you prefer!
The demo now ships with its own 'field_movie_body' instead of relying on the core body field, which means 'facets_demo' successfully installs on a plain standard site again. It keeps the "Body" label and remains a fulltext field right next to 'title', so the actual demo page stays completely unchanged. I also added the missing assertion to 'FacetsDemoTest'.

Note that there is no update hook included. The demo content comes from 'default_content' and is simply meant to be reinstalled.

nitinkumar_7’s picture

Reviewed the changes in MR !404. The approach looks good: the demo `body` field has been replaced with a dedicated `field_movie_body`, and the related field storage, entity displays, Search API index configuration, and demo content have all been updated consistently.
I did not find any issues with the changes. The additional HTTP 200 assertion in `FacetsDemoTest` is also appropriate.

From my prospective, this looks good to me.

nitinkumar_7’s picture

Tested MR !404.

The `FacetsDemoTest::testDemoPage` test passes successfully, and the `/movies` page loads with HTTP 200. The demo page is rendered correctly with the movie listing, search form, and facets.

However, the PHPUnit pipeline is currently failing with exit code 1. The tests shown at the end of the PHPUnit output are passing, but the overall job still reports a failure:

`Exiting with EXIT_CODE=1`

Therefore, I cannot mark the MR as fully passing based on the current pipeline results.

The changes related to replacing the core `body` field with the demo-specific `field_movie_body` appear to work for the Facets demo page, but the PHPUnit pipeline failure needs to be investigated before considering the issue fully verified.

Result: tested - demo functional test passes, but PHPUnit pipeline is failing

peri22’s picture

Thanks for testing this, @nitinkumar_7! Just to clarify, the red pipeline is not caused by this MR.
The 'phpunit' job fails on the 18 REST tests (which are already fixed and RTBC in #3618817: REST tests fail: config entities need ConfigEntityResourceTestBase, and the XML charset changed) and on 'HierarchicalFacetIntegrationTest::testWeightSort' (which is being fixed in #3618692: Term weight and UID processors are not offered on Drupal 11.4). Since this branch is based off plain '3.0.x', neither of those fixes are included in it yet.

If you compare it with today's run on '3.0.x', the only actual change is that 'FacetsDemoTest' successfully went from errored to passing (pipeline 942119, job 11871966).

nitinkumar_7’s picture

Status: Needs review » Reviewed & tested by the community

Thanks for the clarification, @peri22 : that makes sense. Checked pipeline 942119 (job 11871966) on plain 3.0.x as you pointed to, and confirmed the same REST test and HierarchicalFacetIntegrationTest::testWeightSort failures are present there independent of this MR, tracked in #3618817 and #3618692 respectively. So the exit code 1 here isn't a regression from this change.

With that confirmed: FacetsDemoTest::testDemoPage passes, the /movies page loads correctly with facets and search working, and the field/storage/display/Search API changes all look consistent on review. Moving this to RTBC.

joelpittet made their first commit to this issue’s fork.

joelpittet’s picture

Status: Reviewed & tested by the community » Fixed

Green tests whoo! The merge train has left, didn't force it this time, it should stay green. Thanks again @peri22 for proposing the fix, it's a demo, the field doesn't need to be body.

@nitinkumar_7 thanks for testing and confirming it was a fix before the others were committed.

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.

  • joelpittet committed 0d46b60c on 3.0.x authored by peri22
    fix: #3618863 facets_demo cannot be installed: unmet dependency on the...

Status: Fixed » Closed (fixed)

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