[ZBX-2055] flexible interval validation and support for single day intervals Created: 2010 Feb 22  Updated: 2017 May 30  Resolved: 2012 Jul 06

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: API (A), Frontend (F)
Affects Version/s: None
Fix Version/s: 2.0.2rc1, 2.1.0

Type: Incident report Priority: Major
Reporter: Aleksandrs Saveljevs Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: usability, validation
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

In the frontend, flexible intervals are not validated. For instance, a user can create a flexible interval specified as "asdf,123".

While we are at it, it would also be nice to support flexible intervals with a single day. Currently, flexible intervals are expected to have day1-day2 in their specification, like so: "1-5,10:00-18:00". If, for instance, only Monday is desired, we now wish to allow "1,10:00-18:00".



 Comments   
Comment by Aleksandrs Saveljevs [ 2010 Feb 23 ]

Single day specification implemented on the server side in r10367 in svn://svn.zabbix.com/branches/dev/zbx-2055-interval-validation .

Comment by Alexey Fukalov [ 2012 Jul 02 ]

dev branch: svn://svn.zabbix.com/branches/dev/ZBX-2055

Comment by Pavels Jelisejevs (Inactive) [ 2012 Jul 02 ]

(1) The interval "1-2,00:00-24:00;3,00:00-21:00" fails validation with an error:

Incorrect flexible interval "3,00:00-21:00". [CItem.update -> CItem.checkInput -> CItemGeneral.checkInput -> CItemGeneral.validateDelayFlex]

<Vedmak> In items there should be only one interval per row. CLOSED

<richlv> let's document that - REOPENED

Comment by Pavels Jelisejevs (Inactive) [ 2012 Jul 03 ]

(2) Let's rename CItemGeneral::validateDelayFlex to checkDelayFlex according to the guidelines we've discussed some time ago.

<Vedmak> RESOLVED

<pavels> CLOSED.

Comment by Pavels Jelisejevs (Inactive) [ 2012 Jul 03 ]

(3) Lets replace the validateDelayFlex() function with a validator class the way we discussed.

<Vedmak> RESOLVED

<pavels> Please, add the ability to pass additional options to the validator to avoid using different validation methods. CLOSED.

Comment by Pavels Jelisejevs (Inactive) [ 2012 Jul 03 ]

(4) Validation should be performed when adding the interval, not when saving the whole item.

<Vedmak> RESOLVED

<pavels> CLOSED.

Comment by Pavels Jelisejevs (Inactive) [ 2012 Jul 03 ]

TESTED.

Comment by Alexey Fukalov [ 2012 Jul 03 ]

Fixed in pre-2.0.2rc1 r28648, pre-2.1.0rc1 r28649

Comment by Alexey Fukalov [ 2012 Jul 04 ]

(5)
Cannot save item without flexible interval.

<pavels> CLOSED.

Comment by richlv [ 2012 Jul 04 ]

note that this is now a blocker for 2.0.2 because of the fix in 28661

Comment by Pavels Jelisejevs (Inactive) [ 2012 Jul 05 ]

TESTED once again.

Comment by Alexey Fukalov [ 2012 Jul 05 ]

Fixed in pre-2.0.2rc1 r28680, pre-2.1.0rc1 r28681

Comment by Pavels Jelisejevs (Inactive) [ 2012 Jul 06 ]

(6)

When I save an empty time period, I get the following error:

Uninitialized string offset: -1 [include/classes/validators/CTimePeriodValidator.php:40]
Incorrect time period "".

Plus, the error message should say "Incorrect working time" instead of "Incorrect time period."

<Vedmak> RESOLVED

<pavels> CLOSED. I've corrected the test in r28728.

Comment by Alexey Fukalov [ 2012 Jul 06 ]

Fixed in pre-2.0.2rc2 r28729, pre-2.1.0rc1 r28730

Generated at Thu Apr 25 12:50:03 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.