Closed (fixed)
Project:
Drupal core
Version:
7.x-dev
Component:
image system
Priority:
Minor
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
23 Apr 2014 at 18:26 UTC
Updated:
16 Dec 2022 at 18:54 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
sulav commentedComment #2
mgiffordDoes this error apply to D8 as well? I would assume so but haven't checked. If so it would need to be fixed there too.
Comment #3
poker10 commentedThis is not relevant for D9, because in D9 the input type "number" is used and #min and #max properties are set-up (so this is being checked by separate validations). In D7 we are only using input type "text".
D9:
D7:
The patch looks good, however there is a redundant check for
is_numeric():In this part the
$valuemust be numeric, because in the first IF condition there is areturn;in case the variable is not numeric.I have updated the patch (removed the redundant check) and added a simple test for these dimensions, as it seems like we did not have any until now.
Comment #5
yashingole commentedComment #6
yashingole commentedVerified and tested patch #3 on Drupal 7.x. Patch was applied successfully and looks good to me.
Testing steps:
1. Install 7.x
2. Navigate to admin/structure/types/manage/article/fields/field_image
3. Scroll Down to Image Resolution.
4. Set the values in negative.
5. Click on Save.
6. Changes are saved.
7. Apply the patch.
8. Navigate back to admin/structure/types/manage/article/fields/field_image
9. Set the resolution to negative.
10. Click on save.
11. Observe the error displayed.
Testing Result:
1. After applying the patch the error is displayed "Height and width values must be positive numbers."
Can be move to RTBC
Screenshots are attached for reference:
Comment #8
mcdruid commentedGreat, thanks everyone!