Problem

Currently, the Delay and Offset fields are Number field types. However, there is no validation added to it for which user can have negative values for this fields as well which is not acceptable.

Proposed Solution

Add a validation for the Number fields.

'#min' => 0

API Changes

None

Comments

imalabya created an issue. See original summary.

mashir’s picture

Assigned: Unassigned » mashir

I am looking into this.

nkoporec’s picture

StatusFileSize
new1.17 KB

Created a simple patch, which adds #min on both fields so you can enter only unsigned int numbers.

mashir’s picture

Assigned: mashir » Unassigned
Status: Active » Needs review
StatusFileSize
new83.71 KB
new930 bytes

@nkoporec - When a task is assigned to someone and working on that ticket, it does not make sense taking it over.

I have applied patch (#3) and its showing error.

patch_error_6

So I have created another patch and attached it(number_validations-2950365-4.patch) with all changes resolved.

imalabya’s picture

Status: Needs review » Reviewed & tested by the community

Looks good. Thanks, @Mashir @nkoporec for the patches.

  • imalabya committed cc786ec on 8.x-2.x authored by Mashir
    Issue #2950365 by Mashir, nkoporec: Add validations for Number fields
    
imalabya’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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