Changeset View
Changeset View
Standalone View
Standalone View
core/units/helpers/cat_dbitem_export_helper.php
Show First 20 Lines • Show All 1304 Lines • ▼ Show 20 Line(s) | |||||
{ | { | ||||
$available_columns['__CUSTOM__'.$custom_name] = $custom_name; | $available_columns['__CUSTOM__'.$custom_name] = $custom_name; | ||||
} | } | ||||
// columns already in use | // columns already in use | ||||
$items_info = $this->Application->GetVar( $event->getPrefixSpecial(true) ); | $items_info = $this->Application->GetVar( $event->getPrefixSpecial(true) ); | ||||
if ($items_info) | if ($items_info) | ||||
{ | { | ||||
list($item_id, $field_values) = each($items_info); | $field_values = current($items_info); | ||||
$export_keys = $field_values['ExportColumns']; | $export_keys = $field_values['ExportColumns']; | ||||
$export_keys = $export_keys ? explode('|', substr($export_keys, 1, -1) ) : Array(); | $export_keys = $export_keys ? explode('|', substr($export_keys, 1, -1) ) : Array(); | ||||
} | } | ||||
else { | else { | ||||
$export_keys = Array(); | $export_keys = Array(); | ||||
} | } | ||||
$export_columns = Array(); | $export_columns = Array(); | ||||
▲ Show 20 Lines • Show All 125 Lines • ▼ Show 20 Line(s) | |||||
{ | { | ||||
$items_info = $this->Application->GetVar($event->getPrefixSpecial(true)); | $items_info = $this->Application->GetVar($event->getPrefixSpecial(true)); | ||||
if ( !$items_info ) { | if ( !$items_info ) { | ||||
$items_info = unserialize($this->Application->RecallVar($event->getPrefixSpecial() . '_ItemsInfo')); | $items_info = unserialize($this->Application->RecallVar($event->getPrefixSpecial() . '_ItemsInfo')); | ||||
$this->Application->SetVar($event->getPrefixSpecial(true), $items_info); | $this->Application->SetVar($event->getPrefixSpecial(true), $items_info); | ||||
} | } | ||||
list($item_id, $field_values) = each($items_info); | $item_id = key($items_info); | ||||
$field_values = $items_info[$item_id]; | |||||
alex: Replace `$id` with `$item_id`.
---
Code below relying on the `$item_id` variable value became… | |||||
/** @var kDBItem $object */ | /** @var kDBItem $object */ | ||||
$object = $event->getObject(Array ('skip_autoload' => true)); | $object = $event->getObject(Array ('skip_autoload' => true)); | ||||
$object->SetFieldsFromHash($field_values); | $object->SetFieldsFromHash($field_values); | ||||
$field_values['ImportFilename'] = $object->GetDBField('ImportFilename'); //if upload formatter has renamed the file during moving !!! | $field_values['ImportFilename'] = $object->GetDBField('ImportFilename'); //if upload formatter has renamed the file during moving !!! | ||||
$object->setID($item_id); | $object->setID($item_id); | ||||
$this->setRequiredFields($event); | $this->setRequiredFields($event); | ||||
▲ Show 20 Lines • Show All 119 Lines • Show Last 20 Lines |
Replace $id with $item_id.
Code below relying on the $item_id variable value became broken.