Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F1167476
D291.id714.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Tue, Sep 23, 12:53 PM
Size
997 B
Mime Type
text/x-diff
Expires
Wed, Sep 24, 12:53 PM (20 h, 43 m)
Engine
blob
Format
Raw Data
Handle
756227
Attached To
D291: INP-1685 - Handle date fields during CSV import
D291.id714.diff
View Options
Index: core/units/helpers/csv_helper.php
===================================================================
--- core/units/helpers/csv_helper.php
+++ core/units/helpers/csv_helper.php
@@ -303,9 +303,20 @@
}
}
- // 2. set object fields
- foreach($import_data['field_list'] as $position => $field_name) {
- if(isset($data[$position])) {
+ // 2. set object fields.
+ foreach ( $import_data['field_list'] as $position => $field_name ) {
+ if ( isset($data[$position]) ) {
+ $formatter_class = $object->GetFieldOption($field_name, 'formatter');
+
+ if ( $formatter_class !== false ) {
+ $formatter = $this->Application->recallObject($formatter_class);
+
+ // Date columns from grid are exported as 1 field so read them as 1 field as well.
+ if ( $formatter instanceof kDateFormatter ) {
+ $object->SetDBField($field_name . '_combined', 1);
+ }
+ }
+
$object->SetField($field_name, $data[$position]);
}
}
Event Timeline
Log In to Comment