Problem/Motivation

The "Forms to validate" field in general configuration allows for form IDs to be included that should (or should not) be validated.

This works well in most cases, but causes an issue with the use of a module such as Ajax Comments. Ajax Comments replaces comment and comment reply creation with a more dynamic approach.

Since Ajax Comments works without reloading the page, comment form IDs are generated based on the node and comment to which the user is replying. This is an example of a form ID that would be seen for a comment reply, where "168" is the node ID and "764" is the comment ID to which a response is being written: ajax_comments_reply_form_168_764_0.

The current "Forms to validate" field only supports exact matches of form IDs, so there is no option for us to skip Clientside Validation on Ajax Comments fields, which have their own validation. Also it would be impossible to account for every possible combination of ajax_comments_reply_form_* that will ever exist.

Steps to reproduce

Install Clientside Validation and Ajax Comments modules, and attempt to reply to an existing comment. The "comment required" validation included with Ajax Comments never runs, because it is overwritten by Clientside Validation. No message is presented to the user.

Proposed resolution

See the attached patch. The drupal_match_path function provides the ability to match for path wildcards. The same basic approach can be done here. The in_array gets replaced by a preg_match.

Remaining tasks

Review the attached patch, thanks.

Comments

ron_s created an issue.