Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Partially a follow-up of #1174640: Add new HTML5 FAPI element: number: We have a number element - there are more places where it should be used and legacy validation should be replaced. But there are also plain bugs (i.e. missing validation). Those are indicated with a !.
Issue / setting / variable | No validation |
Tests written |
---|---|---|
user_picture_file_size | ! | X |
filter_url_length | ! | X |
Image effects (dimensions, ...) | ||
image_jpeg_quality | ||
minimum_word_size (Search module) | ! | X |
Image field settings (dimensions, file size, ...) |
Comments
Comment #0.0
Niklas Fiekas CreditAttribution: Niklas Fiekas commentedUpdating introduction.
Comment #0.1
Niklas Fiekas CreditAttribution: Niklas Fiekas commentedMake a table.
Comment #1
Niklas Fiekas CreditAttribution: Niklas Fiekas commentedFirst failing tests for user_picture_file_size, filter_url_length and minimum_word_size.
Comment #1.0
Niklas Fiekas CreditAttribution: Niklas Fiekas commentedimage_jpeg_quality is properly validated.
Comment #1.1
Niklas Fiekas CreditAttribution: Niklas Fiekas commentedNew tests created.
Comment #3
Niklas Fiekas CreditAttribution: Niklas Fiekas commentedThat + attempts to add validation.
Comment #5
Niklas Fiekas CreditAttribution: Niklas Fiekas commentedConvert the other occurences.
I am not sure why #3 is still failing, that is: The user configuration form doesn't save invalid input, but it says it does and it also doesn't show validation errors.
Comment #7
Niklas Fiekas CreditAttribution: Niklas Fiekas commentedOk, typo there.
This should do it.
Comment #8
aspilicious CreditAttribution: aspilicious commentedHow can you leave this blank when the minimum value is 1...
Comment #9
Niklas Fiekas CreditAttribution: Niklas Fiekas commentedJust leave it blank ;)
Seriously: The number will only be validated if it is not
''
. So either valid or blank are allowed, unless #required is set.Comment #10
aspilicious CreditAttribution: aspilicious commentedI wrote part of that function
#shame
Comment #11
cosmicdreams CreditAttribution: cosmicdreams commentedRead through patch on #7 but I'm still confused: What's left to do after #7's patch
Comment #12
Niklas Fiekas CreditAttribution: Niklas Fiekas commentedIf everything that's there is OK, that's it.
Comment #13
ericduran CreditAttribution: ericduran commentedThis is awesome. :)
Comment #14
Niklas Fiekas CreditAttribution: Niklas Fiekas commentedRerolling because of #1299424: Allow one module per directory and move system tests to core/modules/system.
Comment #15
bleen CreditAttribution: bleen commentedRTBC
Comment #16
Niklas Fiekas CreditAttribution: Niklas Fiekas commentedThank you for the testing, bleen18.
Comment #17
Niklas Fiekas CreditAttribution: Niklas Fiekas commentedNot to forget: The ones with the ! need to be backported to D7, though we cant use the shiny number element there.
Comment #18
Dries CreditAttribution: Dries commentedGreat job. Nice clean-up. Committed to 8.x.
Comment #19
aspilicious CreditAttribution: aspilicious commentedBack to needs work see #17
Comment #20
Niklas Fiekas CreditAttribution: Niklas Fiekas commentedFortunately only the simple cases were missing validation. That is only integers that must be positive.
Comment #22
Niklas Fiekas CreditAttribution: Niklas Fiekas commentedNext try.
Edit: OK. I believe this is ready.
Comment #23
xjmThe backport looks complete to me. Can't think of a reason not to backport it.
Comment #24
webchickWow, nicely spotted!
Committed and pushed to 7.x. Thanks!
Comment #25.0
(not verified) CreditAttribution: commentedFactor out file field to a seperate issue.