Closed (fixed)
Project:
Smart Date
Version:
3.5.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
29 Mar 2022 at 21:12 UTC
Updated:
26 Jul 2022 at 22:19 UTC
Jump to comment: Most recent, Most recent file


Comments
Comment #2
pyrello commentedAs far as I can tell, this seems to be happening because the JS seems to expect that the
input.alldayelement is going to be present no matter what and that doesn't actually seem to be the case: https://git.drupalcode.org/project/smart_date/-/blob/3.5.x/js/smart_date...In the linked snippet, it will only change the time if it finds the
input.alldayelement AND the element is checked. However if the element doesn't exist, the entire code block is skipped, causing the end time to not be set when it should be.Proposed solution at this point is to add an extra check to the first line to first see if the
input.alldayelement doesn't exist followed by an||and then the current check. A patch is forthcoming.I'm only looking at a particular use case to test this, so it may have other unexpected side effects.
Comment #4
pyrello commentedSetting to needs review to trigger tests. Also I'm uploading a patch because this fixes a bug that we have in production right now.
Comment #6
mandclu commentedThanks for identifying this, and for proposing a fix. I decided that the check you added made the following test for
wrapper.querySelector('input.allday')redundant, so I removed it in favour of the new one. I tested the change with your use case and it still seemed to fix it. Merged in, hoping to roll a new release shortly.Comment #7
pyrello commentedCool! Thanks, @mandclu!