Included a patch that adds a custom error message for the unique property

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

attiks’s picture

same patch without the print_r

quicksketch’s picture

Version: 6.x-3.x-dev » 7.x-4.x-dev
Status: Needs review » Needs work

There is a similar issue for the required message: #889198: Add capability to use custom error message for required field.

As with that issue, I'm not sure this option is worth the additional space in the UI. In any case, this patch would need a reroll for the 4.x branch (where all new features are going) and should avoid abbreviations like "msg". It would be optimal if it borrowed consistency from the other issue. The message needs to use a dedicated FAPI property for compatibility with Form Builder.

quicksketch’s picture

If rerolled, this should take into accounts the suggestions from #889198-24: Add capability to use custom error message for required field also:

- Don't show the text field for customizing the required message unless the checkbox is checked to make it required in the first place. (similar to #1667662: Hide Text for "Other..." textfield by default for Select components)
- Populate the textfield with the default error message at all times, but compare this value against the default on save. Only save the string if it has been customized.
- For the most flexibility, the default string should be a variable retrieved through webform_variable_get().

DanChadwick’s picture

Issue summary: View changes
Status: Needs work » Closed (won't fix)

Closing for lack of activity and demand.