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

Wrong collection settings used on create #238

Closed
smakinson opened this issue Feb 15, 2017 · 1 comment
Closed

Wrong collection settings used on create #238

smakinson opened this issue Feb 15, 2017 · 1 comment

Comments

@smakinson
Copy link

- Do you want to request a feature or report a bug?
Bug report

- What is the current behavior?
Incorrect collection settings used when creating a new item. This was the first thing I created from the admin.

- If the current behavior is a bug, please provide the steps to reproduce.

  • I am running the admin locally using the victor-hugo server script.
  • I have the base folders in site for hugo committed.
  • I clicked the pencil icon and chose the second collection ( Event Type ) in the config
  • I was taken to a proper form.
  • I filled in its title field ( the only field ) and clicked save.
  • I was taken to the edit form for the first collection in the config ( it has more fields )
  • I saw that the .md file on github had the incorrect fields. ( though title was in both collections )

I am using:
publish_mode: editorial_workflow

Here are the collections from the config ( I did notice afterwards that I should have had site/ in the folder paths, but I don't think that should have caused the issue ):

collections:
  - name: "event"
    label: "Event"
    folder: "content/events"
    create: true
    slug: "{{year}}-{{month}}-{{day}}-{{slug}}"
    fields:
       - { label: "Title", name: "title", widget: "string", default: "" }
       - { label: "Main Image", name: "main-image", widget: "image", default: "" }
       - { label: "Event Type", name: "event-type", widget: "string", default: "" }
       - { label: "Start Date", name: "start-date", widget: "datetime", default: "" }
       - { label: "Audience", name: "audience", widget: "string", default: "" }
       - { label: "Cost", name: "cost", widget: "string", default: "Free" }

       - { label: "Description", name: "description", widget: "markdown", default: "" }
  - name: "event-type"
    label: "Event Type"
    folder: "content/event-types"
    create: true
    slug: "{{slug}}"
    fields:
       - { label: "Title", name: "title", widget: "string", default: "" }

The problem did not occur on creating a second Event Type.

I do have this as my last line in the config for copy paste. I assume comments will be ignored:
#- { label: "", name: "", widget: "", default: "" }

Also as I'm typing this I noticed I had left a blank line between the Cost and Description when I reordered them.

- What is the expected behavior?
The proper collection fields to be used for creating the .md file and the proper form to be shown.

- Please mention your node.js, and operating system version.
node v6.9.4
osx 10.11.6

@erquhart
Copy link
Contributor

@smakinson I don't believe this is still an issue, please re-open if so.

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

2 participants