[ZBX-9065] Default value for screens_items.max_columns in schema.inc.php is incorrect Created: 2014 Nov 21  Updated: 2017 May 30  Resolved: 2014 Dec 02

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: API (A), Frontend (F)
Affects Version/s: 2.4.2, 2.5.0
Fix Version/s: 2.4.3rc1, 2.5.0

Type: Incident report Priority: Critical
Reporter: Alexander Vladishev Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: dbpatches
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   
$ php create/bin/gen_php.php 
$ mv create/src/schema.inc.php frontends/php/include/.
$ svn di
Index: frontends/php/include/schema.inc.php
===================================================================
--- frontends/php/include/schema.inc.php        (revision 50710)
+++ frontends/php/include/schema.inc.php        (working copy)
@@ -494,7 +494,7 @@
                                'null' => false,
                                'type' => DB::FIELD_TYPE_INT,
                                'length' => 10,
-                               'default' => '1',
+                               'default' => '3',
                        ),
                ),
        ),


 Comments   
Comment by Alexander Vladishev [ 2014 Nov 21 ]

The issue was moved from ZBXNEXT-1583 (28).

Comment by Krists Krigers (Inactive) [ 2014 Nov 21 ]

Column "max_columns" has a meaning only in context of resource types "19" (simple graph prototypes) and "20" (graph prototypes).
The only scenario when "max_columns" value will not have the default value without it being explicitly defined is following:
1) a screen item is first created with "resourcetype" different than "19" or "20" and "max_columns" is set to "null" - in which case default value is taken from schema.inc.php ("1"). Frontend does this.
2) then this item gets updated manually using screenitem.update API - and "resourcetype" is set to "19" and "20" AND "max_column" is not set at all. In this case "max_columns" will retain the value "1". (If "max_columns" is set to "null", validation error occurs). If this is done via frontend, value of "max_columns" gets set to default from constant SCREEN_SURROGATE_MAX_COLUMNS_DEFAULT when screen item type is changed (or item is created).

Comment by Alexander Vladishev [ 2014 Nov 25 ]

Ok, please fix it in schema.inc.php and describe it in the documentation: Zabbix API changes in 2.4

Comment by Krists Krigers (Inactive) [ 2014 Nov 25 ]

It is not quite clear to me what to write in API changelog regarding default value change in schema.inc.php.

sasha Please fix the default value in schema.inc.php and describe the problems which it will fix in API changelog.

Default value for this field in schema.inc.php is incorrect.

Comment by Krists Krigers (Inactive) [ 2014 Nov 26 ]

Schema file fixed in r50875, branch svn://svn.zabbix.com/branches/dev/ZBX-9065 (copy of branches/2.4).

Comment by Krists Krigers (Inactive) [ 2014 Nov 26 ]

(1) No string changes.

sasha CLOSED

Comment by Krists Krigers (Inactive) [ 2014 Nov 26 ]

(2) Update API changelog for 2.4: https://www.zabbix.com/documentation/2.4/manual/api/changes_2.4.

sasha RESOLVED

martins-v Reviewed. CLOSED.

Comment by Krists Krigers (Inactive) [ 2014 Dec 01 ]

Fixed and merged to:

  • 2.4.3rc1 in r50950,
  • 2.5.0 (trunk) in r50951.
Generated at Fri Apr 26 22:17:26 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.