Jump to:

3460 Posts in 1064 Topics by 739 members

Data Model Questions

SilverStripe Forums » Data Model Questions » SS3 ModelAdmin, DataObject with $field_labels CSV import/export problems

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

Page: 1
Go to End
Author Topic: 454 Views
  • Jogi
    Community Member
    3 Posts

    SS3 ModelAdmin, DataObject with $field_labels CSV import/export problems Link to this post

    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

Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.