The Webform Date Restriction module extends the core webform module's Date Component to allow for restricted dates.
This will disable dropdown options and datepicker dates based off of certain criteria.

Project Link

https://www.drupal.org/sandbox/wmcmillian-coalmarch/2826680

Git clone command

git clone --branch master https://git.drupal.org/sandbox/wmcmillian-coalmarch/2826680.git webform_date_restriction

Comments

wmcmillian-coalmarch created an issue. See original summary.

wmcmillian’s picture

Issue summary: View changes
PA robot’s picture

We are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and put yourself on the high priority list, then we will take a look at your project right away :-)

Also, you should get your friends, colleagues or other community members involved to review this application. Let them go through the review checklist and post a comment that sets this issue to "needs work" (they found some problems with the project) or "reviewed & tested by the community" (they found no major flaws).

I'm a robot and this is an automated message from Project Applications Scraper.

vipul.patil7888’s picture

Hi wmcmillian-coalmarch,
Thanks for your contribution. I have tested this.
Current testing flow:

1. Fresh vanilla Drupal installed 7.x
2. Installed the module via drush and all dependencies were asked and got installed. (Install instructions attached)
3. As per readme.md, while creating the date component, got warning for Token module (screenshot attached)

Thanks

saveva’s picture

Hi Will.

I did a manual review of your code and I installed the module on a test site without problems. I did not do any further testings apart from installation, activation and deactivation. I found two things that you should consider:

1. Coding style & Drupal API usage:
Include a hook_help implementation for your module.

2. README.md:
Correct the README.md. In the introduction section "based off of" should read "based on"

3. You should set a master version in your project. To do so access your sandbox project and under Version Control set the version to work from to 7.x-1.x as the default version.

Regards.
uh

saveva’s picture

klausi’s picture

@saveva: Thanks for your review! Is this now RTBC or are there application blockers left and this should be "needs work"?

saveva’s picture

Status: Needs review » Needs work

Hi Klausi, hi Will.

Returning to this to answer the question posted by Klausi: I did some further tests and added a date field to a webform. The configured webform restrictions for dates apply if you select dates with dropdown selects but if you use a datepicker the datepicker loses connection with the date form fields (no update). Once you disable the plugin date selection via the jquery popup calendar works.

Another point is that the jquery datepicker only partially shows the configured restrictions, e.g. it does not apply configured year restrictions in the jquery popup calendar.

From my viewpoint your plugin should be compatible with the basic features offered by the webform module. At least you should test this and inform the user that your plugin does not allow to use the jquery popup for date selection. I set this to "needs work" but if you feel that this is an error, please reset to "needs review".

Regards.
uh

wmcmillian’s picture

Hello all,

I have addressed the issues brought up here:

@saveva:
I've fixed the datepicker issues, it should work as expected (tied to date elements, year excluded, etc).
I've implemented a hook_help function
And I've corrected the grammatical issue in the README.md

@vipul.patil7888
The warning is issued via theme_webform_token_help() in the webform module and appears to be intentional. It's unrelated to my module, so there is nothing I can do.

I've also, through a suggestion IRL, added an option to restrict by relative dates.

I've updated this to "Needs Review" accordingly.

wmcmillian’s picture

Status: Needs work » Needs review
sandip27’s picture

Status: Needs review » Needs work

Hello @wmcmillian-coalmarch,

I did some automated test for the module and findings can be found at pareview.sh Review

FILE: /root/repos/pareviewsh/pareview_temp/webform_date_restriction.module
--------------------------------------------------------------------------
FOUND 31 ERRORS AND 1 WARNING AFFECTING 27 LINES
--------------------------------------------------------------------------
14 | ERROR | [x] Opening brace should be on the same line as the
| | declaration
15 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found
| | 4
16 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found
| | 4
16 | ERROR | [x] Expected 1 space after SWITCH keyword; 0 found
17 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found
| | 8
18 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found
| | 12
20 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found
| | 12
20 | ERROR | [x] Expected 1 space after IF keyword; 0 found
21 | ERROR | [x] Line indented incorrectly; expected 8 spaces, found
| | 16
22 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found
| | 12
23 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found
| | 12
24 | ERROR | [x] Line indented incorrectly; expected 8 spaces, found
| | 16
25 | ERROR | [x] Line indented incorrectly; expected 8 spaces, found
| | 16
26 | ERROR | [x] Line indented incorrectly; expected 8 spaces, found
| | 16
33 | WARNING | [x] A comma should follow the last multiline array item.
| | Found: $cid
36 | ERROR | [x] Line indented incorrectly; expected 8 spaces, found
| | 16
36 | ERROR | [x] Expected 1 space after IF keyword; 0 found
37 | ERROR | [x] Line indented incorrectly; expected 10 spaces, found
| | 20
38 | ERROR | [x] Line indented incorrectly; expected 8 spaces, found
| | 16
39 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found
| | 12
40 | ERROR | [x] Case breaking statement indented incorrectly;
| | expected 10 spaces, found 12
41 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found
| | 4
43 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found
| | 4
95 | ERROR | [x] Whitespace found at end of line
96 | ERROR | [x] Expected 1 space after IF keyword; 0 found
100 | ERROR | [ ] Variable "DT" starts with a capital letter, but only
| | $lowerCamelCase or $snake_case is allowed
101 | ERROR | [ ] Variable "DT" starts with a capital letter, but only
| | $lowerCamelCase or $snake_case is allowed
103 | ERROR | [x] Expected 1 space after CATCH keyword; 0 found
104 | ERROR | [x] No space found before comment text; expected "//
| | nothing" but found "//nothing"
104 | ERROR | [x] Inline comments must start with a capital letter
104 | ERROR | [x] Inline comments must end in full-stops, exclamation
| | marks, colons, question marks, or closing
| | parentheses
109 | ERROR | [x] Whitespace found at end of line
--------------------------------------------------------------------------
PHPCBF CAN FIX THE 30 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------

FILE: /root/repos/pareviewsh/pareview_temp/README.md
----------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
----------------------------------------------------------------------
15 | WARNING | Line exceeds 80 characters; contains 82 characters
48 | WARNING | Line exceeds 80 characters; contains 88 characters
----------------------------------------------------------------------

FILE: /root/repos/pareviewsh/pareview_temp/webform_date_restriction.inc
--------------------------------------------------------------------------
FOUND 17 ERRORS AND 7 WARNINGS AFFECTING 22 LINES
--------------------------------------------------------------------------
27 | WARNING | [ ] Only string literals should be passed to t() where
| | possible
47 | WARNING | [ ] Only string literals should be passed to t() where
| | possible
73 | ERROR | [x] Whitespace found at end of line
94 | WARNING | [ ] Do not concatenate strings to translatable strings,
| | they should be part of the t() argument and you
| | should use placeholders
147 | WARNING | [ ] Do not concatenate strings to translatable strings,
| | they should be part of the t() argument and you
| | should use placeholders
225 | WARNING | [ ] Do not concatenate strings to translatable strings,
| | they should be part of the t() argument and you
| | should use placeholders
269 | ERROR | [x] Whitespace found at end of line
271 | ERROR | [x] Whitespace found at end of line
287 | WARNING | [ ] Do not concatenate strings to translatable strings,
| | they should be part of the t() argument and you
| | should use placeholders
309 | ERROR | [x] Whitespace found at end of line
313 | ERROR | [x] Whitespace found at end of line
317 | ERROR | [x] Whitespace found at end of line
399 | ERROR | [x] Whitespace found at end of line
492 | ERROR | [x] Whitespace found at end of line
499 | ERROR | [x] Whitespace found at end of line
526 | ERROR | [ ] Variable "DT" starts with a capital letter, but only
| | $lowerCamelCase or $snake_case is allowed
528 | ERROR | [x] Expected 1 space after CATCH keyword; 0 found
730 | WARNING | [x] A comma should follow the last multiline array item.
| | Found: 'phpval'
765 | ERROR | [x] Whitespace found at end of line
830 | ERROR | [x] Whitespace found at end of line
839 | ERROR | [x] Expected 1 space after CATCH keyword; 0 found
840 | ERROR | [x] No space found before comment text; expected "//
| | nothing" but found "//nothing"
840 | ERROR | [x] Inline comments must start with a capital letter
840 | ERROR | [x] Inline comments must end in full-stops, exclamation
| | marks, colons, question marks, or closing
| | parentheses

Thanks

PA robot’s picture

Status: Needs work » Closed (won't fix)

Closing due to lack of activity. If you are still working on this application, you should fix all known problems and then set the status to "Needs review". (See also the project application workflow).

I'm a robot and this is an automated message from Project Applications Scraper.