Closed (outdated)
Project:
IP address fields
Version:
2.0.0
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
10 Mar 2022 at 13:38 UTC
Updated:
24 Apr 2026 at 08:04 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
ilya.no commentedAttaching initial patch.
Comment #3
wjackson commentedWorks for me! Marking RTBC! Thank you, ilya.no!
Comment #4
mikemccaffreyI don't think the solution is to pass the value as is if it is wrong, since we do actually need to deal with the fact that the IP address is not a properly formatted range (or if someone had the gall to try to enter a range using asterisks).
The validateIpAddressElement function in IpAddressWidgetBase.php actually depends on there being an exception to validate the form field:
The question is why the IpAddress function isn't being constructed within that try catch in the validation function on form submission.
Comment #5
kelly.m.jacobs commentedAs an alternative solution, this patch will change it so we only run the massageFormValues logic if the form has passed validation.
Comment #6
hexblot commentedfixed by commit a29b74c under #3247108 — note that @ilya.no proposed the same fix in patch #2 here two years earlier; sickness29's later MR also carried the try/catch and was what ultimately landed.
Comment #7
hexblot commented