Multiple Office Hours fields on same Content Type breaks Exceptions

Created on 14 November 2023, 11 months ago
Updated 1 December 2023, 10 months ago

Problem/Motivation

Adding multiple Office Hours fields both configured with the "Exceptions" functionality doesn't work.
It seems like this might be a known issue in code, but I didn't find any reported issue in the issue queue.

Notice the @todo comment on line 23 here:
https://git.drupalcode.org/project/office_hours/-/blob/8.x-1.x/src/Plugi...

Steps to reproduce

  1. Add and configure an "Office Hours" field on a Content Type. Enable the "Exceptions" feature (field settings + widget)
  2. Add another "Office Hours" field on the same Content Type, also enabling the same settings as above.
  3. Populate both fields as needed
  4. Click "Add exception" in one of the widgets
  5. Notice that the exception row is added to the incorrect field. Interacting with the "Add exception" button on either field has sporadic results

Proposed resolution

The widget interactions should be tied to the field instance, not just "the first office hours field in the form".

Remaining tasks

Narrow-down the issue and come up with a route to fix it.

πŸ› Bug report
Status

Fixed

Version

1.12

Component

Code - widget

Created by

πŸ‡ΊπŸ‡ΈUnited States Nuuou Lincoln, NE

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

Comments & Activities

Production build 0.71.5 2024