From fd350d1e4398e8bcfd3bb933fd1f1cc6f82ea8a1 Mon Sep 17 00:00:00 2001 From: Huejack Date: Fri, 5 Jun 2020 10:13:36 +0300 Subject: [PATCH] fix: renaming iblock element property --- src/Autocreate/Handlers/OnBeforeIBlockPropertyUpdate.php | 1 + templates/auto/update_iblock_element_property.template | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Autocreate/Handlers/OnBeforeIBlockPropertyUpdate.php b/src/Autocreate/Handlers/OnBeforeIBlockPropertyUpdate.php index 76d90ae..718a94b 100644 --- a/src/Autocreate/Handlers/OnBeforeIBlockPropertyUpdate.php +++ b/src/Autocreate/Handlers/OnBeforeIBlockPropertyUpdate.php @@ -64,6 +64,7 @@ public function getReplace() 'fields' => var_export($this->fields, true), 'iblockId' => $this->fields['IBLOCK_ID'], 'code' => "'".$this->fields['CODE']."'", + 'oldCode' => "'".$this->dbFields['CODE']."'", ]; } diff --git a/templates/auto/update_iblock_element_property.template b/templates/auto/update_iblock_element_property.template index c551d5c..63cddd4 100644 --- a/templates/auto/update_iblock_element_property.template +++ b/templates/auto/update_iblock_element_property.template @@ -15,7 +15,7 @@ class __className__ extends BitrixMigration { $fields = __fields__; - $id = $this->getIblockPropIdByCode(__code__, __iblockId__); + $id = $this->getIblockPropIdByCode(__oldCode__, __iblockId__); $fields['ID'] = $id; $ibp = new CIBlockProperty();