Impossible to install without body field

Created on 12 March 2025, 6 months ago

Problem/Motivation

On my website, I don't have a field with the system name "body." When I try to activate the module, I get the following error:

Unable to install Push Framework due to unmet dependencies: core.entity_view_display.node.page.push_framework (field.field.node.page.body)

Proposed resolution

Do not add the "body" field by default in the view mode and remove the dependencies in the configuration file core.entity_view_display.node.page.push_framework ?

πŸ› Bug report
Status

Active

Version

2.3

Component

Code

Created by

πŸ‡«πŸ‡·France rmpereira

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @rmpereira
  • πŸ‡«πŸ‡·France rmpereira

    I think it could also be a problem if we don't have a "page" content type.

  • πŸ‡©πŸ‡ͺGermany jurgenhaas Gottmadingen

    I was actually wondering, when we implemented this a few years ago, whether this issue would ever come up. Now, it actually happened, but I'm not sure if we can address this. The whole notification template system is built around the assumption that a notification has a subject and a body. That's what most channels also require, the most popular example being an email notification.

    I don't think we have a way to provide a generic solution that wouldn't even have that common ground. Unless, there is something I'm missing, it looks like this module is not for sites that are restricted that much and would allow for a body field.

  • πŸ‡©πŸ‡ͺGermany jfeltkamp Hamburg

    Hey JΓΌrgen,
    Sounds like there is a missunderstanding. I have the same problem here and thats why we stuck on version 2.3.4. We have no node type "page" but also definitly want to use push_framework module.

    Since Version 2.3.5 there are dependencies in the config/install/core.entity_view_display.node.page.push_framework.yml for the config entities:

    • field.field.node.page.body
    • node.type.page

    @jurgenhaas Could you have a look on this? https://git.drupalcode.org/project/push_framework/-/blob/2.3.x/config/in...

  • πŸ‡©πŸ‡ͺGermany jurgenhaas Gottmadingen

    @jfeltkamp that's exactly what I was talking about in #3. To render notifications, we've built this to use an entity with a title and a body. And the assumption has been made, that the node bundle page would be providing that, which I still assume is the case is the vast majority of Drupal sites.

    I understand that you have a site which doesn't have that, and that's unfortunate. If somebody has a proposal on how we could do rendering otherwise, I'm happy to discuss them and review MRs for this.

  • πŸ‡©πŸ‡ͺGermany joachim namyslo Kulmbach πŸ‡©πŸ‡ͺ πŸ‡ͺπŸ‡Ί

    Hey, you!

    I also tried to install the module today in conjunction with https://www.drupal.org/project/pf_notifications β†’ in a Drupal CMS Installation.

    Of course, when I activate the module, I get exactly the same error message because the body field is no longer available in the Page content type in Drupal CMS either.

    The default field is now called field_content. This means that the module is currently not usable even in the new standard download of Drupal.

    Is there a way to allow the user to configure the desired filed that should serve as an alternative for β€žbodyβ€œ? Eg via a Drush command or the settings page in the ui?

    Maybe the module can show just a message about the fact that this is neccecary once afte installing the module to make it work finally?

    This is not yet a merge request, but perhaps the dilemma can be resolved in this way.

    It would be a shame if everyone who uses Drupal CMS and therefore no longer has a field named Body in the Page content type could no longer use the Push Framework.

  • πŸ‡©πŸ‡ͺGermany jurgenhaas Gottmadingen

    I've looked through the code again and I can't find any hard coded usage of the body field or the page node type. Both only appear in the provided default config in the install directory:

    • core.entity_view_display.node.page.push_framework.yml
    • core.entity_view_mode.node.push_framework.yml

    Maybe by moving them into the optional directory, that may already resolve the issue.

Production build 0.71.5 2024