Cannot connect unit types to event types in D10

Created on 20 December 2023, 11 months ago
Updated 3 April 2024, 8 months ago

Problem/Motivation

I encountered issues with the BAT module. When following the documentation to set up the module, I faced errors in creating and saving event types a type bundle, specifically when dealing with availability (fixed) and arbitrary (open) event states. The errors include:

  • Warning: Undefined array key "events" in Drupal\bat_event\EventTypeForm->save() (line 226 of /app/web/modules/contrib/bat/modules/bat_event/src/EventTypeForm.php)
  • Warning: Trying to access array offset on value of type null in Drupal\bat_event\EventTypeForm->save() (line 226 of /app/web/modules/contrib/bat/modules/bat_event/src/EventTypeForm.php)
  • Warning: Undefined array key "events" in bat_event_form_bat_type_bundle_form_submit() (line 870 of /app/web/modules/contrib/bat/modules/bat_event/bat_event.module)
  • Warning: foreach() argument must be of type array|object, null given in bat_event_form_bat_type_bundle_form_submit() (line 870 of /app/web/modules/contrib/bat/modules/bat_event/bat_event.module)

Steps to reproduce

To reproduce the issue:

  1. Follow the BAT module documentation to set up the module.
  2. Attempt to create event types with fixed : availability and arbitrary: cost event states
  3. Save the changes and observe the PHP errors mentioned above.
  4. Create a bundle type (e.g., meeting room) and add fields (entity reference referencing State and a simple integer field).
  5. Attempt to access the select fields on the edit page and observe the errors in drupal logs

Proposed resolution

Any assistance or guidance on resolving these issues would be greatly appreciated.

Remaining tasks

None specified.

User interface changes

None specified.

API changes

None specified.

Data model changes

None specified.

🐛 Bug report
Status

Closed: outdated

Version

10.0

Component

Code

Created by

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

Comments & Activities

  • Issue created by @Merrydbe
  • 🇮🇳India SandeepSingh199

    I have tried in my local with drupal 10.1, but not able to replicate. Everything is working fine in this module.

  • Thanks for looking into the issue. I appreciate your effort to replicate it on your local environment. However, I'm still encountering the errors even after a fresh installation with the following setup:

    Drupal 10.1.6
    "drupal/bat": "10.x-dev@dev"
    Enabled modules: bat , bat_unit and bat_event

    I've attempted to reproduce the problem multiple times, including a fresh installation, but the errors persist.
    Could you please confirm if there are any additional modules or specific configurations you have in your environment that might be influencing the outcome?

  • I've created a patch that fixes this issues After applying the patch, error logs are gone, and everything seems to be running smoothly.
    im not sure if this is a good approach tho.

  • Status changed to Needs review 11 months ago
  • 🇮🇳India SandeepSingh199

    I am not using any additional modules or specific configurations. It might be issue exists & I am not able to replicate. Thanks for the patch. Marking this to Needs Review.

  • Status changed to Closed: outdated 8 months ago
Production build 0.71.5 2024