- Issue created by @bernardopaulino
- 🇳🇱Netherlands johnv
Indeed, this is a known bug. Not sure how to solve this, either.
- 🇮🇳India divyansh.gupta Jaipur
I was able to reproduce the bug and had created a MR which resolved the bug for me,
Please review - 🇳🇱Netherlands johnv
Thank you, but is is not correctly working when the entity already as 1 or more exceptions saved.
- 🇮🇳India divyansh.gupta Jaipur
Made some changes and now things are working perfectly fine on my local.
Please review. - 🇳🇱Netherlands johnv
Thank you for your efforts. Please see my attached patch (sorry for not using MR).
That patch only contains a one-line change (thanks to your efforts, though).
Please review, and[stat preparations]
- set 'number of slorts per day' to 3;
- edit node, add 2 exceptions and save.
[start test]
- edit node again,
- add exception, 3 times
- fill 2nd exception with 1 or more timeslots,
- add exception, --> too many slots are added.Does that happen with your patch, too?
Even if so, i guess that can be considered as an edge case we can leave alone.Regarding your patch:
- please do not rename variables, it makes the patch harder to understand.
- the fallback to NULL, do you encounter an erroro if not, in if (($dv['day'] ?? NULL) !== 'exception_day_delta') { ?
- teh check for array, do you encounter an arrray if not, in if (is_array($default_values)) { ? - 🇮🇳India divyansh.gupta Jaipur
@johnv,
i have updated my MR to make minimal variable changes and i was able to reproduce the error but by these following steps:- Set Number of slots per day to 3.
- Create a node with an Office Hours field (exceptions enabled).
- Add 2 exceptions and save.
Now edit the node again:
- Click “Add exception” 3 times → 3 new empty rows appear.
- Fill the 2nd exception with one or more timeslots.
- Click “Add exception” again → too many rows are added (2 instead of 1).
- Further clicks only add one row at a time.
I also tested your patch, but I still ran into the original behavior described in the issue. It’s possible I may have missed a configuration detail on my side — just wanted to share my findings.
Can you also please review my latest changes. - 🇳🇱Netherlands johnv
Thanks a lot. This was a long time annoying bug.
The resulting patch also prevents 'null' records to be coming in.