[ZBX-7335] Copying elements, dropdown shows groups with no hosts Created: 2013 Nov 12  Updated: 2017 May 30  Resolved: 2014 Apr 23

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

Type: Incident report Priority: Trivial
Reporter: Ivo Kurzemnieks Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: copy, dropdown, graph, item, trigger
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File empty_host_groups_while_copying_element.png    
Issue Links:
Duplicate
is duplicated by ZBX-7672 "copy to" lists templates under hosts Closed

 Description   

Copying an element (item, trigger and graph), dropdown displays groups that don't have hosts. Therefore there are no targers and pressing copy error is inevitable. Only groups with hosts should be displayed in dropdown.



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

(1) Also please fix this ZBX-7672: separate hosts and templates into two lists.

kristsk RESOLVED in r44488.

jelisejev CLOSED.

Comment by Krists Krigers (Inactive) [ 2014 Apr 16 ]

Committed in r44488, branch svn://svn.zabbix.com/branches/dev/ZBX-7335.

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

(2) Copying to templates does not work.

jelisejev CLOSED.

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

(3) Some general coding issues:
1. it's best to avoid using API_OUTPUT_EXTEND and list specific fields instead;
2. we don't use empty(), "empty($data['filter_groupid'])" should be rewritten as "$data['filter_groupid'] == 0";
3. There should be a space after "if" in "if($data['copy_type'] == 1) {".

kristsk RESOLVED in r44584, r44624.

jelisejev CLOSED.

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

(4) When opening the copying form, the first host group must be selected by default.

kristsk RESOLVED in r44584.

jelisejev CLOSED.

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

(5) The getCopyElementsFormData() function should return hosts and templates under separate keys.

kristsk RESOLVED in r44584.

jelisejev CLOSED.

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

(6) It would be great to introduce constants to replace literal "copy_to" values.

kristsk RESOLVED in r44584.

jelisejev It would be better to rename the constant to "COPY_TYPE_*" so that it would match the name of the parameter.

kristsk RESOLVED in r44656.

jelisejev CLOSED.

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

(7) The JS code that resets "filter_groupid" when submitting a form should be removed, so that if some group contains both templates and hosts, it would be remembered.

kristsk RESOLVED in r44584.

jelisejev CLOSED.

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

(8) Let's refactor the code that displays the item copying form so that it would also use the getCopyElementsFormData() function and the configuration.copy.elements.php view file.

kristsk RESOLVED in r44584.

jelisejev
1. It's better to rename the "filter_groupid" used by the copy form to something like "copy_groupid" to avoid conflicts with the item filter form parameter with the same name.
2. The "CONFIGURATION OF ITEMS" is gone from the item copying page.

kristsk RESOLVED in r44656.

jelisejev The "filter_groupid" parameter is no longer used and can be removed from graphs.php and triggers.php.

kristsk RESOLVED in r44704.

jelisejev CLOSED.

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

(9) I've made some changes to the code in 44651, please review.

kristsk CLOSED

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

(10) The following error appears after copying a trigger:

Illegal offset type in isset or empty [triggers.php:309 → getRequest() → hasRequest() in /opt/lampp/htdocs/zabbix/trunk/frontends/php/include/func.inc.php:63]

kristsk RESOLVED in r44656.

jelisejev CLOSED.

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

TESTED.

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

(11) These changes need to be documented (this issue also includes changes from ZBX-7672).

Comment by Krists Krigers (Inactive) [ 2014 Apr 23 ]

Merged and committed to trunk in r44708.

Generated at Wed Mar 19 22:09:07 EET 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.