Unable to add, remove or copy timeslot

Created on 27 February 2024, 10 months ago
Updated 25 June 2024, 6 months ago

Problem/Motivation

Since the last update to 1.16, I am not able to add, remove or copy timeslots anymore.

It looks that this comes from the changes in issue https://www.drupal.org/project/office_hours/issues/3135259 ✨ Replace operation links in the widget with a dropbutton Needs work and that the selector on the id attribute is not the correct one because an id can be appended at the end of the id attribute.\

HTML:

JS:

Not relevant for the main issue but something I've also noticed
In combination with the Chosen module β†’ and after applying my patch, the copy time slot only copies the minutes and not hours because the hours are a chosen element in my case. I have 'fixed' that issue by disabling chosen for my admin pages (not preferable).

Steps to reproduce

1. Create a new paragraph type with an office hours field (not sure if the paragraph part is necessary) and add the paragraph type to a content type.
2. Create a new node of the content type and add a new office hours field
3. Click on 'Add time slot'
4. You will be redirected to your frontpage

Proposed resolution

I have added a patch that selects the element through the data-drupal-selector attribute and not the id attribute.

Remaining tasks

Review the changes because my knowledge of JS is limited.

πŸ› Bug report
Status

Closed: duplicate

Version

1.16

Component

Code - widget

Created by

πŸ‡§πŸ‡ͺBelgium jonas139

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

Comments & Activities

Production build 0.71.5 2024