Event.php data_table annotation breaks views in 10.1

Created on 22 April 2024, 7 months ago
Updated 27 July 2024, 4 months ago

Problem/Motivation

After updating to version 10.1 of the bat module, the relationship in some of my views broke. I get errors about broken/missing handlers in the view fields and relationships. I tracked the reason down to being that the line

*   data_table = "bat_event__event_dates",

was added to the annotation of Drupal\bat_event\Entity\Event.php in the last commit to 10.1. If I remove this new line from the annotation my views work as before. If I keep the line my views break. I also noticed that I'm only able to create a relationship to a User entity if I leave the line in the annotation:

but if I remove the line, I have access to many more relationship links. Some of them come from fields I've configured on other entities, but some also seem to come from the core of BAT (unit reference, event state, event series, booking):

Steps to reproduce

  1. Install BAT 10.1, leave the "data_table" line in the annotation
  2. Create a blank view targeting Event entities of type availability_hourly or availability_daily. Add a page or block to the view.
  3. Under the advanced section, click create relationship. Note the nr of relationships available (only User relationship should be available).
  4. Cancel out of the dialog
  5. Remove the data_table line from the annotation of Drupal\bat_event\Entity\Event.php, clear/refresh Drupal cache.
  6. In the view editor, again click create relationship. Note that the nr of available relationships has changed (there should now be more relationships available).

Any idea why this happens? It seems somehow the link to the other tables (bat_event__event_bat_unit_reference, bat_event__event_state_reference, etc) in the database is lost when the data_table line is added, but I have no idea why.

🐛 Bug report
Status

Needs review

Version

10.1

Component

Code

Created by

🇫🇮Finland jwwj

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

Comments & Activities

Production build 0.71.5 2024