Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Last column not imported #28

Open
mspacemedia opened this issue Sep 29, 2015 · 0 comments
Open

Last column not imported #28

mspacemedia opened this issue Sep 29, 2015 · 0 comments

Comments

@mspacemedia
Copy link

I have been importing a dataset that looks like this:

Town County PostCode Longitude Latitude
Westdene East Sussex BN1 5 -0.16129 50.86153
Brighton East Sussex BN1 6 -0.13361 50.8431

However unless I add a further column to the right:

Town County PostCode Longitude Latitude Extra
Westdene East Sussex BN1 5 -0.16129 50.86153 abc
Brighton East Sussex BN1 6 -0.13361 50.8431 def

The latitude column doesn't get imported into any records. Using the original ModelAdmin importer works fine with the same dataset...

The class looks like this

class Area extends DataObject {

    static $db = array(
        'Town' => 'Text',
        'County' => 'Text',
        'PostCode' => 'Text',
        'Longitude' => 'Text',
        'Latitude' => 'Text',
        'Sort' => 'Int'
    );

So nothing scary there and the import is added to a Page getCMSFields gridfield like this:

$fields->addFieldToTab('Root.Areas', GridField::create('Areas', 'Areas we cover', $this->Areas(), $gfc = GridFieldConfig_RelationEditor::create()));
        $gfc->addComponent(new GridFieldOrderableRows('Sort'));
        $importer = new GridFieldImporter('before');
        $gfc->addComponent($importer);

Any ideas?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant