Created
October 3, 2011 06:07
-
-
Save orakili/1258533 to your computer and use it in GitHub Desktop.
#1217396 - Drupal 7.x - Link - Required field & optional title produces validation error.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git link.module link.module | |
index 98c8b3a..c862795 100644 | |
--- link.module | |
+++ link.module | |
@@ -232,7 +232,7 @@ function link_field_validate($entity_type, $entity, $field, $instance, $langcode | |
} | |
} | |
- if ($instance['settings']['url'] == 'optional' && $instance['settings']['title'] == 'optional' && $instance['required'] && !$optional_field_found) { | |
+ if ($instance['settings']['url'] === 'optional' && $instance['settings']['title'] === 'optional' && $instance['required'] && !$optional_field_found) { | |
form_set_error($field['field_name'] .'][0][title', t('At least one title or URL must be entered.')); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment