event_instances computed field has no provider set

Created on 17 January 2024, over 1 year ago
Updated 16 February 2024, about 1 year ago

Problem/Motivation

See πŸ› Computed field definitions created by inheritance have no provider set Fixed for related issue in field_inheritance.

The event_instances computed field created by recurring_events_entity_base_field_info_alter() does not set a provider (module). If this field is then used in a Search API index, it causes the search index config to be exported with a dependency on a null module, which in turn causes the following error when the config is imported:

Configuration search_api.index.my_index depends on the "" module that will not be installed after import.

Steps to reproduce

  1. Install the Search API module and configure a search server.
  2. Install the Recurring Events module.
  3. Create a search index for eventseries entities.
  4. Add the event_instances field to the index.
  5. Export the config.

Expected results: The exported search_api.index.my_index.yml should contain values similar to the following:

dependencies:
  config:
    - search_api.server.elasticsearch
  module:
    - search_api
    - recurring_events

and

field_settings:
  event_instances:
    label: 'Event Instances'
    datasource_id: 'entity:eventseries'
    property_path: event_instances
    type: integer
    dependencies:
      module:
        - recurring_events

Actual results: The config declares dependencies on a null module, like so:

dependencies:
  config:
    - search_api.server.elasticsearch
  module:
    - ''
    - search_api
    - recurring_events

and

field_settings:
  event_instances:
    label: 'Event Instances'
    datasource_id: 'entity:eventseries'
    property_path: event_instances
    type: integer
    dependencies:
      module:
        - null

Proposed resolution

On the $fields['event_instances'] = BaseFieldDefinition::create('entity_reference') statement chain, call ->setProvider('recurring_events').

πŸ› Bug report
Status

Fixed

Version

2.0

Component

Recurring Events (Main module)

Created by

πŸ‡ΊπŸ‡ΈUnited States muriqui

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024