Index: branches/5.2.x/core/install/upgrade_helper.php =================================================================== diff -u -N -r14244 -r14870 --- branches/5.2.x/core/install/upgrade_helper.php (.../upgrade_helper.php) (revision 14244) +++ branches/5.2.x/core/install/upgrade_helper.php (.../upgrade_helper.php) (revision 14870) @@ -1,6 +1,6 @@ _toolkit =& $instance; } + /** + * Replaces deprecated detail template design with new one + * + * @param string $prefix + * @param string $from_template + * @param string $to_template + */ + function _updateDetailTemplate($prefix, $from_template, $to_template) + { + $sql = 'SELECT CustomFieldId + FROM ' . TABLE_PREFIX . 'CustomField + WHERE FieldName = "' . $prefix . '_ItemTemplate"'; + $custom_field_id = $this->Conn->GetOne($sql); + + $ml_formatter =& $this->Application->recallObject('kMultiLanguage'); + /* @var $ml_formatter kMultiLanguage */ + + $field = $ml_formatter->LangFieldName('cust_' . $custom_field_id, true); + + $sql = 'UPDATE ' . TABLE_PREFIX . 'CategoryCustomData + SET ' . $field . ' = "' . $to_template . '" + WHERE ' . $field . ' = "' . $from_template . '"'; + $this->Conn->Query($sql); + } }