Problem/Motivation
The link 'Copy previous day' does not work for exception days.
Steps to reproduce
When you use the widget 'Office Hours (week) with exceptions', there is a part for normal weekdays, and below a part to 'add exception days'.
The link 'copy previous day' works fine for normal weekdays, but it does not do anything for Exception days.
Proposed resolution
option 1: hide the link
option 2: when a second exception day is created, the 'copy previous day' link should copy the values from the exception day right before the current one. The date may stay empty, or be filled with some sensible value (when still empty - keep the same when user has already provided data.)
Comment | File | Size | Author |
---|---|---|---|
#8 | issue-3331785-8-copy-link-exception-hour.patch | 1.45 KB | ebremner |
Comments
Comment #2
MukhtarM CreditAttribution: MukhtarM as a volunteer and at Srijan | A Material+ Company for Drupal India Association commentedCan you elaborate the issue a bit more? I am getting it right when copying previous day for working hours
Comment #3
johnvI added extra explanation in the Issue Summary.
Comment #4
akalam CreditAttribution: akalam at Dropsolid commentedI can confirm this issue with the other widgets
Comment #5
akalam CreditAttribution: akalam at Dropsolid commentedThis is only failing when the field is configured to use select form elements, when using input html5 elements the copy feature works fine.
After looking closer, I think this commit might introduce the issue https://git.drupalcode.org/project/office_hours/-/commit/93ff3da18e18d40...
There's a big refactor on the office_hours.js file on the dev release. I didn't test it, but it could be already fixed on the dev release. Can somebody test it there?
Comment #6
ebremner CreditAttribution: ebremner at University of Waterloo commentedI can confirm that this is happening with HTML 5 time as well and with the 1.8 and dev versions. My suggestion is not to have the copy previous day for exceptions since it does not really make sense for this case. They will just add exceptions not use other days. Will try and create a patch to remove the link.
Comment #7
johnvI can imagine a use case where you want to enter a list exceptions, that are (almost) identical. The link would then copy the hours, leaving the date alone. YOu will maintain the dates separately.
Comment #8
ebremner CreditAttribution: ebremner at University of Waterloo commentedOk well the Copy link is not working at all for exception hours, can we remove it for now until that is fixed. I will provide a patch now to make this happen.
Comment #10
johnvIndeed, better no functionality the broken functionality.
The problem occurs both in Exception List widget as in basic list widget (to be toggled with the Widget)
However, I decided to spend too much time fixing this. Having learned a lot about (debugging) javascript, though.
Thanks anyway.
Comment #11
ebremner CreditAttribution: ebremner at University of Waterloo commentedHi John,
The Copy link is still not working for me in exception hours, it just sits there.
Thanks,
Eric
Comment #12
johnvComment #13
johnvI tested on Edge, Chrome, Firefox.
The only problem I encountered, is that the JS was not refreshed in Firefox.
You need to refresh the edit page using [CTRL+F5], not just [F5], to explicitely reload the JS.
Not sure why this is happening.
Comment #15
ebremner CreditAttribution: ebremner at University of Waterloo commentedYes it works as expected now with dev and a refreshed browser.