Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Data Model Questions /

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

SS3 ModelAdmin, DataObject with $field_labels CSV import/export problems


Go to End


1324 Views

Avatar
Jogi

Community Member, 3 Posts

8 April 2013 at 9:07am

Edited: 08/04/2013 9:08am

Hey everybody,

I'm currently struggeling of an import / export problem of CSV data in my ModelAdmin. The issue is, that I'm perfectly able to export the dataobjec's data to a CSV file - the file looks and I'm also able to edit the data - but on import (also straight after export without any editing) I'm only receiving fully blank/empty entries.

I already analysed the problem and found out that the issue is based on the $field_labels and the mappings I defined in the DataObject. If I remove the defined mappings, export and import perform as expected.

The issue is, that during the CSV Export, the data tables original identifies are not getting transferred to the csv file. On Import SS3 is not able to automatically remap the defined alternative names (of the $field_labels array) back to the database original table column names and fills the unknown columns with blank entries.

Do I have to specify a custom CSV Import/Export function in this case?
And how does this has to look like - I already tried to undestand how this works with the API Doku but can't get on with it.

Thanks in advanced and greets
Jogi