Reason:

The table schema limits the name column to 32 characters, and there isn't any validation to stop more than 32 being inserted.

Where?

This happens in two different forms since there are two different places one can add/edit/delete rules: at admin/structure/field_validation/list and admin/structure/types/manage/%bundle/fields/%field_name/validation

Turns out the former comes from field_validation_export_ui.inc and the latter from field_validation.admin.inc

Solutions

1. Regarding field_validation_export_ui.inc, I cannot find where the "Name" field (of type machine_name) is added. It should have a #maxlength property of 32, or there should be some code in field_validation_ctools_export_ui_form_validate() to check that the length is not greater than 32.

2. Regarding field_validation.admin.inc, attached is a patch to add the #maxlength property. This stops the user from entering more than 32 characters into the textfield, rather than validating upon submission.

I have marked this as major becuase this is the only full release of the field_validation module. I understand the move to ctools plugin, and I guess that field_validation_export_ui.inc was the beginning of this.

Regards,
Henry Blyth

Comments

henryblyth’s picture

StatusFileSize
new584 bytes

Here's the patch.

henryblyth’s picture

StatusFileSize
new1.29 KB

The previous patch only fixes the issue with field_validation_manage_rule() in field_validation.admin.inc.

The following patch also includes a fix for field_validation_ctools_export_ui_form_validate() in field_validation_export_ui.inc. However, I think this should be accomplished the same way as the first, by using the #maxlength property on the name form element, which I think is of type machine_name.

Regards,
Henry

g089h515r806’s picture

Yes, this is a bug.
Also exist in 7.x-2.x

henryblyth’s picture

Does this bug extend any further than the two examples which the patch in #2 fixes?

If not, is it possible to get this committed to a 7.x-1.1 release for those of us that don't yet want to upgrade to 7.x-2.x?

Cheers,
Henry

g089h515r806’s picture

Status: Active » Fixed

Commit it to dev version.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Anonymous’s picture

Issue summary: View changes

extra info