[ZBX-16376] Incorrect generation of the order of preprocessing steps Created: 2019 Jul 15  Updated: 2024 Apr 10  Resolved: 2019 Jul 23

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Frontend (F)
Affects Version/s: 4.0.10
Fix Version/s: 4.0.11rc1, 4.4 (plan)

Type: Problem report Priority: Critical
Reporter: Edgar Akhmetshin Assignee: Ivo Kurzemnieks
Resolution: Fixed Votes: 3
Labels: preprocessing
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: JPEG File proc3.jpg     JPEG File sql2.jpg    
Issue Links:
Causes
Sub-task
part of ZBX-16388 Add explicit check/update to preproce... Closed
Team: Team B
Sprint: Sprint 54 (Jul 2019)
Story Points: 1

 Description   

Problem 1:
/include/classes/api/services/CItemGeneral.php:

protected function createItemPreprocessing(array $items) {
                $item_preproc = [];
                $step = 1;
 
                foreach ($items as $item) {
                        if (array_key_exists('preprocessing', $item)) {
                                foreach ($item['preprocessing'] as $preprocessing) {
                                        $item_preproc[] = [
                                                'itemid' => $item['itemid'],
                                                'step' => $step++,
                                                'type' => $preprocessing['type'],
                                                'params' => $preprocessing['params']
                                        ];
                                }
                        }
                }

Variable definition $step=1 is outside of the foreach cycle, 99999+ step can be generated.

Problem 2:
The same step generation:

Result:
Steps are performed out of order.

Expected:
Steps are performed in step by step order.



 Comments   
Comment by Ivo Kurzemnieks [ 2019 Jul 16 ]

This has already been fixed in v4.2+, so this fix is for 4.0 only.

RESOLVED in feature/ZBX-16376-4.0

Comment by Ivo Kurzemnieks [ 2019 Jul 19 ]

Fixed in 4.0.11rc1 76b63cc

Generated at Fri Apr 26 01:21:24 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.