Pennebaker / craftcms-thearchitect

CraftCMS plugin to generate content models from JSON data.
MIT License
171 stars 9 forks source link

Import failing for section without URLs #25

Closed steverowling closed 8 years ago

steverowling commented 8 years ago

The Architect 1.5.3.1

I've just tried exporting a section with all fields, where the Section is enabled for one locale only (out of two locales for the site) and the section doesn't have URLs enabled.

When importing into a second Craft installation, the Section creation fails with the error: "At least one locale must be selected for the section."

This then causes the Entry Type creation to fail since the Section has not been created.

The section part of the JSON export from the first site is below:

{
    "sections": [
        {
            "name": "AC Student Records",
            "handle": "acStudentRecords",
            "type": "channel",
            "enableVersioning": 0,
            "typesettings": {
                "hasUrls": 0,
                "urlFormat": null,
                "template": null,
                "en_gb_access": {
                    "urlFormat": null,
                    "nestedUrlFormat": null
                }
            }
        }
    ]
}
spAnser commented 8 years ago

Starting to think something changed in craft. I swear this was all working in my testing when I made it work the first time. 😃

spAnser commented 8 years ago

Nope nothing changed. I was not importing if those were set to null. Did no realize when there is no URLs that the locale still needs to be set obviously. If you want to test try the latest commit to the hotfix branch

steverowling commented 8 years ago

Just tried the 1.5.4 hot-fix branch.

Section and entry type has imported. However, the section should only be enabled for one of the two locales and it has been enabled for both locales in the import. Also, Entry versioning has been enabled for the section and it should be disabled.

spAnser commented 8 years ago

Let me know if 1.5.4.1 does not fix this.