Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F1182156
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
Wed, Oct 15, 7:44 PM
Size
997 B
Mime Type
text/x-diff
Expires
Thu, Oct 16, 7:44 PM (6 h, 3 m)
Engine
blob
Format
Raw Data
Handle
767619
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