Weekday timeslots are lost after adding an Exception

Created on 28 February 2024, 10 months ago
Updated 13 March 2024, 10 months ago

Problem/Motivation

In version 1.16, the following problem occurs when editing a node with office_hours field

Steps to reproduce

- edit a node with seasons and exceptions enabled.
- add a weekday, save, edit again
- press the 'Add another item' to add an exception. No need to actually add an exception. Save.
- See that the weekday data is lost.

Proposed resolution

This happens since objects are re-used.
The [Add another item] button calls ExeptionsWidget~addMoreSubmit(), which in turn calls $form_state->setRebuild();
Then in ComplexWeekWidget,~formElement(), the last season is used for normal weekdays.

The season must be set/reset explicitly.

🐛 Bug report
Status

Fixed

Version

1.16

Component

Code - widget

Created by

🇳🇱Netherlands johnv

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

Comments & Activities

Production build 0.71.5 2024