Closed (outdated)
Project:
Webform
Version:
7.x-4.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
11 Jul 2018 at 14:23 UTC
Updated:
23 Sep 2025 at 14:08 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
nmillin commentedComment #3
nmillin commentedUpdated patch file. There was a bug where multiple days of the week could not be selected when using OR.
Comment #4
liam morlandThanks for the patch. This will need tests.
The #options array does not need to specify the key since those are the keys they would have anyway by default.
Please ensure all functions have complete documentation including @param and @return.
Comment #5
nmillin commentedThanks for the feedback. I'm going to update the patch based on what you said. Just updating the patch since it had duplicate code and I wanted to make sure others aren't using a bad patch file.
Comment #6
liam morlandInstead of having your own list of days, use webform_options_days().
Comment #7
nmillin commented@Liam I might be missing something, but doesn't webform_options_days function need to have a webform $component passed into it?
Just looking into callback_webform_options and webform_options_days I wasn't sure if I can leverage webform_options_days for displaying the days of the weeks as a dropdown. If you could please point me in the right direction, that would be greatly appreciated. Thanks.
Comment #8
liam morlandIt doesn't use any of its parameters. Just pass it NULLs.
Comment #9
nmillin commented*facepalm* Thanks Liam.
Attaching an updated patch to use webform_options_days() & include complete documentation. I added to WebformTestCase.test for the match conditional values and mismatch conditional values, but I don't know how to debug the failing tests. Any chance you can point me in the right direction again?
Comment #10
liam morlandIt looks like it is comparing a date array to the string day of the week. There are functions to convert dates to day of the week.
Comment #11
nmillin commentedI believe this will pass the tests now. There was a capitalization issue that was making a === return false. I want to make sure this passes the tests before I go further.
Comment #12
nmillin commented@Liam, I finally got back to this & it is passing now. Any chance you can review the patch and let me know what you think?
*Note* This does add 2 coding standards messages. They are:
1329 Type hint "Object" missing for $node
1797 Type hint "array" missing for $input_values
I'm assuming these aren't blockers at this time. Let me know if these need to be reviewed.
Thank you.
-Nate
Comment #13
mweixel commentedWas this ever resolved? We have exactly the same use case for a site that isn't ready for D9 yet. Has anyone tried applying the patch against a full release version of Webform or one of the later dev versions?
Comment #14
nmillin commented@mweixel we've been using the patch in #11 (I wrote) for the last 2.5 years. It applies cleanly to the latest release (7.x-4.24). It would be great if you could test it out so this could be moved forward.
Comment #15
liam morlandDrupal 7 is no longer supported. If this applies to a supported version, please re-open.