[ZBX-9018] administration -> general -> other sets options not on that page Created: 2014 Nov 10  Updated: 2017 May 30  Resolved: 2015 Jan 05

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Frontend (F)
Affects Version/s: 2.2.7
Fix Version/s: 2.5.0

Type: Incident report Priority: Trivial
Reporter: richlv Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: sql
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

administration -> general -> other page has no trigger severity name fields, but updating settings on that page overwrites those fields :

UPDATE config SET default_theme='originalblue',event_ack_enable='1',event_expire='7',event_show_max='100',dropdown_first_entry='1',dropdown_first_remember='1',max_in_table='50',search_limit='1000',server_check_interval='10',severity_name_0='Not classified',severity_name_1='Information',severity_name_2='Warning',severity_name_3='Average',severity_name_4='High',severity_name_5='Disaster'


 Comments   
Comment by richlv [ 2014 Nov 10 ]

(1) note that simply opening that page does :

SELECT c.* FROM config c
SELECT c.* FROM config c

we probably should not select all fields, and probably should not do that twice...

oleg.egorov As was discussed, that is ok. We use select_config(), which return all fields

CLOSED

<richlv> why is it called twice here ? -> REOPENED

oleg.egorov I will try improve. But first select is in header and second in controller.
It the same as ZBX-8643 (5)
https://support.zabbix.com/browse/ZBX-8643?focusedCommentId=122395&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-122395

RESOLVED

sasha The same problem with Administration->Housekeeper page. Please fix it too. REOPENED.

Also it is called twice when saving changes on Administration->Others page.

oleg.egorov RESOLVED IN r51016

sasha CLOSED

Comment by Oleg Egorov (Inactive) [ 2014 Nov 21 ]

(2) String changes

new strings:
  • Field \"%1$s\" is not correct: %2$s
removed strings:
  • "Display OK triggers" needs to be "0" or a positive integer.
  • "Triggers blink on status change" needs to be "0" or a positive integer.
  • Incorrect working time.
  • Severity name cannot be empty.
  • Zabbix server activity check interval

sasha RESOLVED

oleg.egorov CLOSED

Comment by Oleg Egorov (Inactive) [ 2014 Nov 21 ]

FIXED IN svn://svn.zabbix.com/branches/dev/ZBX-9018 r50729 and r50731

Comment by Alexander Vladishev [ 2014 Dec 11 ]

(3) I made some improvements in r51109,51115. Please review.

oleg.egorov CLOSED

Comment by Oleg Egorov (Inactive) [ 2014 Dec 22 ]

(4) Coding style:

  1. In many places was removed "// VAR TYPE OPTIONAL FLAGS VALIDATION EXCEPTION", but in adm.housekeeper.php still exist
  2. After copyright message only one line break in profiles.inc.php
  3. Please add PHPDoc
  4. Usually we don't use line break in this situation
    	else {
    		// set default configuration
    
    		$config = array();
    

sasha

1. 2. RESOLVED in r51313
3. I did not add new functions. In any case all changed functions will be moved into a server side API. I think it is unnecessary now.
4. if the comment is related to several blocks of code we need to add an empty line

sasha Updated PHP coding guidelines#Comments

oleg.egorov CLOSED

Comment by Oleg Egorov (Inactive) [ 2014 Dec 22 ]

(5) Unnecessary default value for getRequest
For example in adm.workingtime.php:77

$config = select_config();

if (hasRequest('form_refresh')) {
	$data = array('work_period' => getRequest('work_period', $config['work_period']));
}
else {
	$data = array('work_period' => $config['work_period']);
}

Possible improve to:

if (hasRequest('form_refresh')) {
	$data = array('work_period' => getRequest('work_period'));
}
else {
	$config = select_config();
	$data = array('work_period' => $config['work_period']);
}

Default value for getRequest is never used. Because if exist $_REQUEST['form_refresh'], $_REQUEST['work_period'] exist too.

Same issue exist in other places.

sasha It will be fixed after implementation of the new validation of input parameters. These parameters should be "required" if form_refresh is set.

sasha Discussed with oleg.egorov. WON'T FIX

Comment by Oleg Egorov (Inactive) [ 2014 Dec 22 ]

(6) validation.inc.php: 390
check_type validation

		if (!$timePeriodValidator->validate($var)) {
			$error = true;
			$message = _s('Field "%1$s" is not correct: ivalid time period.', $caption);
		}

There is possible use CTimePeriodValidator error message

I suggest use something like this:

		if (!$timePeriodValidator->validate($var)) {
			$error = true;
			$message = _s('Field "%1$s" is not correct: %2$s', $caption, $timePeriodValidator->getError());
		}

Because validator have more different error messages. Which can help to understand real problem.

sasha I agree. RESOLVED in r51314.

oleg.egorov CLOSED

Comment by Oleg Egorov (Inactive) [ 2014 Dec 23 ]

(7) Audit log
For example Administration->General->Other
Changed "Refresh unsupported items (in sec)" fron 600 to 599, but in audit log:

Refresh unsupported items (in sec) "599".; Group for discovered hosts "Discovered hosts".; User group for database down messa...

  1. Group for discovered hosts "Discovered hosts"... and other options I didn't change, but they in audit log description
  2. In description is only new value. Previous value has been lost

Please change description, they should be as host/host groups... and other normal places

hosts.host: oleg => olegPC
hosts.name: oleg => OLEG PC
hosts.description: => Test

sasha I did not fix audit log problems. I leave it "as is". It will be fixed on server side API.

sasha As discussed with oleg.egorov. WON'T FIX

Comment by Oleg Egorov (Inactive) [ 2014 Dec 23 ]

(8) If removed config
Now in 2.5 everywhere displayed error message

Unable to select configuration.

But now is OK, was loaded default values.

Open Administration->General
Change config value
After saving "Configuration updated" on the green background
Form refreshed with corrects values

But no row in DB

sasha I know about these issues. Let's discuss it later.

sasha RESOLVED in r51366.

oleg.egorov CLOSED

Comment by Oleg Egorov (Inactive) [ 2014 Dec 23 ]

(9)

  1. Open Trigger displaying options
  2. Reset to default
  3. Save
  4. Uncheck blink from
  • Unacknowledged PROBLEM events
  • Acknowledged PROBLEM events
  • Unacknowledged OK events
  1. Save
  • Unacknowledged PROBLEM events
  • Acknowledged PROBLEM events
  • Unacknowledged OK events

Have checked blink

sasha Thanks a lot! RESOLVED in r51315.

oleg.egorov CLOSED

Comment by Oleg Egorov (Inactive) [ 2015 Jan 05 ]

TESTED

Comment by Alexander Vladishev [ 2015 Jan 05 ]

Fixed in pre-2.5.0 (trunk) r51380.

Generated at Sat Apr 27 05:56:22 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.