<?php declare(strict_types = 0);
foreach ($data['preprocessing'] as $step) {
$preprocessing[] = $step + [
'error_handler' => ZBX_PREPROC_FAIL_DEFAULT,
'error_handler_params' => ''
$formgrid = (new CFormGrid())
->setId('item_preproc_list')
_('Preprocessing steps'),
_('Preprocessing is a transformation before saving the value to the database. It is possible to define a sequence of preprocessing steps, and those are executed in the order they are set.'),
_('However, if "Check for not supported value" steps are configured, they are always placed and executed first (with "any error" being the last of them).')
new CFormField(getItemPreprocessing($preprocessing, $data['readonly'], $data['preprocessing_types']))
(new CLabel(_('Type of information'), 'label-value-type-steps'))
->addClass('js-item-preprocessing-type'),
(new CFormField((new CSelect('value_type_steps'))
->setFocusableElementId('label-value-type-steps')
->setValue($data['item']['value_type'])
->addOptions(CSelect::createOptionsFromArray($data['value_types']))
->setReadonly($data['readonly'])
))->addClass('js-item-preprocessing-type')