diff --git a/forms/class/forms.php b/forms/class/forms.php index f29267e..7089497 100644 --- a/forms/class/forms.php +++ b/forms/class/forms.php @@ -793,7 +793,7 @@ // для правильного вывода селектов if (empty($form['mail_set']['receivers'])) $form['mail_set']['receivers'] = array(0 => array()); - + // Добавляем проверку, чтобы избежать ошибки if (is_array($form['fields'])) { @@ -936,7 +936,14 @@ // обновляем форму с данными примера $this->form_save($fid); // подставляем в шаблон новые id полей - $demo['form_tpl'] = preg_replace_callback('/\[tag:fld:(\d+)]/', create_function('$matches','return "[tag:fld:" . $_REQUEST["demo_change"][(int)$matches[1]] . "]";'),$demo['form_tpl']); + $demo['form_tpl'] = preg_replace_callback( + '/\[tag:fld:(\d+)]/', + function($matches) { + return "[tag:fld:" . ($_REQUEST["demo_change"][(int)$matches[1]] ?? '') . "]"; + }, + $demo['form_tpl'] + ); + $AVE_DB->Query(" UPDATE " . PREFIX . "_module_forms_forms SET