[ZBX-7809] Changing Y min/max value from 'item' to other type does not reset the corresponding database fields to null Created: 2014 Feb 13  Updated: 2017 May 30  Due: 2014 Apr 16  Resolved: 2014 Apr 15

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Frontend (F)
Affects Version/s: 2.0.11rc2
Fix Version/s: 2.2.4rc1, 2.3.0

Type: Incident report Priority: Minor
Reporter: Andris Zeila Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: consistency, graphs
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by ZBX-7992 Undefined Index CGraph->validateItems... Closed

 Description   

Steps:
1) Create a graph with Y axis MIN value set to an item.
2) Then change the Y axis MIN value to 'calculated'

Result:
The corresponding graphs.ymin_itemid field still has the old itemid value.

Expected result:
The corresponding graphs.ymin_itemid field must be set to null.



 Comments   
Comment by Alexander Vladishev [ 2014 Feb 17 ]

@2.2: When deleting such items an incorrect error occurred:

ERROR: Cannot delete item
No permissions to referred object or it does not exist!
Comment by Eduards Samersovs (Inactive) [ 2014 Feb 18 ]

Fixed in development branch svn://svn.zabbix.com/branches/dev/ZBX-7809

Comment by Oleg Egorov (Inactive) [ 2014 Feb 19 ]

(1) In CGraph.php:729-732, used construction $field.'_itemid'
Please use full names

Eduards RESOLVED r.42805

oleg.egorov This construction still exist

Eduards RESOLVED r.42848

oleg.egorov CLOSED

Comment by Oleg Egorov (Inactive) [ 2014 Feb 19 ]

(2) Open graph, change Y axis MIN value to fixed and set "-", then again change Y axis MIN value to item and set any correct item.
-> Save
-> Result: Field "yaxismin" is not decimal number.

Eduards RESOLVED r.42866

oleg.egorov CLOSED

Comment by Oleg Egorov (Inactive) [ 2014 Feb 19 ]

(3) Fixed value should be removed, if changed type

Eduards RESOLVED r.42866

oleg.egorov CLOSED

Comment by Oleg Egorov (Inactive) [ 2014 Feb 19 ]

(4) Remove graph items -> Save -> Graph updated
Without any error, and changes not saved in DB

Eduards RESOLVED r.42879

oleg.egorov CLOSED

Comment by Oleg Egorov (Inactive) [ 2014 Feb 25 ]

Please revert css and style changes

Eduards RESOLVED r.42984

oleg.egorov CLOSED

Comment by Oleg Egorov (Inactive) [ 2014 Feb 25 ]

(5) In graph edit, fixed value is 0.0000 and 100.0000, but should be 0 and 100

Eduards RESOLVED r.43002

oleg.egorov CLOSED

Comment by Oleg Egorov (Inactive) [ 2014 Feb 25 ]

(6) Select fixed Y max, for example, and it should be empty, press save.
Field "yaxismax" is mandatory.
And field again is not empty

oleg.egorov CLOSED

Comment by Oleg Egorov (Inactive) [ 2014 Feb 27 ]

(7) Function "formatValueByScale" should be documented

Eduards This function is removed r.43092

oleg.egorov CLOSED

Comment by Oleg Egorov (Inactive) [ 2014 Feb 27 ]

(8) Now in fixed Y min/max impossible add large values,
9999999999999999->1.0E+16

In 2.2 was ok

Eduards RESOLVED r.43092

oleg.egorov CLOSED

Comment by Oleg Egorov (Inactive) [ 2014 Feb 27 ]

(9) After saving with error, reset incorrect value to 0, or other value
For example, Fixed Y axis MIN value:
2,5->2
a->0

Eduards RESOLVED r.43092,r.43096

oleg.egorov CLOSED

Comment by Oleg Egorov (Inactive) [ 2014 Feb 28 ]

(10) Incorrect floating part of numeric value "0.00000".
Better write max number count after dot

Incorrect number part of numeric value "9999999999999999999999999999".
Why it is incorrect?

Please add more details in error messages

Eduards RESOLVED r.43686

oleg.egorov CLOSED

Comment by Oleg Egorov (Inactive) [ 2014 Feb 28 ]

(11) "Y axis MIN value" set Fixed and value 18+
Then press "Preview".

This will result in endless process with high CPU usage.

Eduards Cannot reproduce

oleg.egorov Will be fixed in ZBX-7957. CLOSED

Comment by Oleg Egorov (Inactive) [ 2014 Feb 28 ]

(12) New validation is OK, but in the same form somewhere it is, somewhere isn't...
Float fields:

  • Percentile line (left)
  • Percentile line (right)

Eduards RESOLVED r.43692

oleg.egorov CLOSED

Comment by Oleg Egorov (Inactive) [ 2014 Feb 28 ]

(13) For T_ZBX_DBL exist first part validation, and for T_ZBX_BIG_DBL not exist.
First part error can reproduce with number:
.9

Eduards RESOLVED r.43686

oleg.egorov CLOSED

Comment by Oleg Egorov (Inactive) [ 2014 Feb 28 ]

(14) Fatal/Blocker errors should be displayed as error, not info in validate.inc.php

Eduards RESOLVED r.43686

oleg.egorov CLOSED

Comment by Oleg Egorov (Inactive) [ 2014 Feb 28 ]

(15) Big code duplication in validate.inc.php

Eduards RESOLVED r.43686

oleg.egorov CLOSED

Comment by Oleg Egorov (Inactive) [ 2014 Feb 28 ]

(16) In defines.inc.php added new type - T_ZBX_BIG_DBL with value 3, but this type was used before for T_ZBX_PERIOD. This changes should be reverted and T_ZBX_BIG_DBL please change from 3 to 9

Eduards RESOLVED r.43686

oleg.egorov CLOSED

Comment by Pavels Jelisejevs (Inactive) [ 2014 Mar 04 ]

(17) Some CNumericValidator validator issues:

  1. let's rename it to CDecimalValidator, since it's meant specifically for decimal numbers;
  2. before trying to explode the decimal value, it should validate if it's a valid decimal number;
  3. it recognizes "10e+1" as a valid decimal number.
  4. the "scaleBeforePoint" and "scaleAfterPoint" option names are a bit incorrect. Since it's a decimal validator, I suggest we go with the common approach of defining decimal numbers using "precision" and "scale": precision is the total digit count in a number and scale - the digit count after the decimal point (e.g. 12.324 has a precision of 5 and a scale of 3). The options can then be called "maxPrecision" and "maxScale" - much clearer.

Eduards RESOLVED r.43686

oleg.egorov CLOSED

Comment by Pavels Jelisejevs (Inactive) [ 2014 Mar 04 ]

(18) The error messages are incorrect, I suggest to change them to:

  • Value "value" of "field" is too long: the maximum length is %maxLength% digits. (note that this message talks about the total length of the decimal number, see (17.4))
  • Value "value" of "field" has too many digits after the decimal point: it cannot have more then "%maxScale%" digits.

Eduards RESOLVED r.43686

oleg.egorov CLOSED

Comment by Alexey Pustovalov [ 2014 Mar 05 ]

Just for a note, it can call the next error with queries:

[Z3005] query failed: [1451] Cannot delete or update a parent row: a foreign key constraint fails (`zabbix`.`graphs`, CONSTRAINT `c_graphs_3` FOREIGN KEY (`ymax_itemid`) REFERENCES `items` (`itemid`)) [delete \ 
from screens_items where resourcetype in (3,1) and resourceid=471004; 
delete from profiles where idx='web.favorite.graphids' and source='itemid' and value_id=471004; 
delete from items where itemid=471004; 
Comment by richlv [ 2014 Mar 11 ]

just another note on some topics we all know about...

a) "In graph edit, fixed value is 0.0000 and 100.0000, but should be 0 and 100" - how do you know ?
maybe decimal part should be there to let users know that they can use it ? =)
what i mean, we REALLY lack basic documents on how things should operate (like "clicking on x should open y and default value should be 'foo'"

oleg.egorov Was discussed.

b) looking at all the subissues i have to wonder how much time we will waste on fixing things over and over again before test-driven development will finally happen

Comment by richlv [ 2014 Mar 25 ]

(19) this issue has been set to "resolved", but nothing has been added regarding potentially changed translatable srtings

2.2 new strings:

  • Value "%1$s" of "%2$s" has incorrect decimal format.
  • Value "%1$s" of "%2$s" is too long: it cannot have more than %3$s digits before the decimal point and more than %4$s digits after the decimal point.
  • Value "%1$s" of "%2$s" has too many digits before the decimal point: it cannot have more than %3$s digits.
  • Value "%1$s" of "%2$s" has too many digits after the decimal point: it cannot have more than %3$s digits.

<richlv> "then" has been used in place of "than"

Eduards RESOLVED r.43742

oleg.egorov CLOSED

Comment by Oleg Egorov (Inactive) [ 2014 Mar 26 ]

(20) Y axis MIN value fixed: 99999999999999999 (17 digits)

Go yo preview.
Error: Page received incorrect data
Value "99999999999999999" of "yaxismin" is too long: the maximum length is 16 digits.

OK, go back and set 9999999999999999 (16 digits)
Then again back to preview

Error: Page received incorrect data
Value "99999999999999999" of "yaxismin" is too long: the maximum length is 12 digits.

16 -> 12...

Eduards RESOLVED r.43754

oleg.egorov CLOSED

Comment by Oleg Egorov (Inactive) [ 2014 Mar 27 ]

(21) Create new graph
Y axis MIN value: Fixed: 9999999999999999
Y axis MAX value: Fixed

Error message:
Value "9999999999999999" of "yaxismin" has too many digits before the decimal point: it cannot have more than 12 digits.

But I don't press on "Save" button.

oleg.egorov CLOSED

Comment by Oleg Egorov (Inactive) [ 2014 Mar 27 ]

TESTED

Comment by Eduards Samersovs (Inactive) [ 2014 Apr 07 ]

Fixed in versions 2.3.0 (trunk) r.44133, 2.2.4rc1 r.44132

Comment by Pavels Jelisejevs (Inactive) [ 2014 Apr 15 ]

(22) Instead of implementing CDecimalValidator::$label you should use CDecimalValidator::setObjectName().

Eduards RESOLVED r.44423 in development branch svn://svn.zabbix.com/branches/dev/ZBX-7809

jelisejev Please list all of the translatable strings that have been changed in this fix.

Eduards Already done in (19)

Comment by Pavels Jelisejevs (Inactive) [ 2014 Apr 16 ]

(23) The API changelog has not been updated.

Eduards RESOLVED in https://www.zabbix.com/documentation/2.2/manual/api/changes_2.2?&#graph

Comment by Pavels Jelisejevs (Inactive) [ 2014 Apr 16 ]

The fix is ok, but the dev branch has been created for trunk, while the problem also needs to be fixed in 2.2. Don't forget to fix it there.

Also, close (22) before merging.

TESTED.

Comment by Eduards Samersovs (Inactive) [ 2014 Apr 16 ]

Fixed in versions 2.3.0 (trunk) r.44504, 2.2.4rc1 r.44503

Comment by richlv [ 2014 Sep 09 ]

this has resulted in a regression : ZBX-8727

Generated at Fri Apr 19 12:06:26 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.