Can't create new page in panel: "Too Many Keys"

When attempting to add a new page via the panel dashboard, I get the following error message:

Error
Too many keys: label: Options:

I’m on Kirby 2.2.3- this problem didn’t appear with previous versions, but I’m not convinced it’s a result of upgrading to 2.2.3. Any help you can provide would be much appreciated!

Sounds as if there’s something wrong with a blueprint. Could you post the blueprint for the type of page you want to add?

I’m not trying to add a specific page, just any new page- when I click on the Add button above the page listing in the Dashboard, it immediately spits out that error message before giving me the option to select a template. I’ve included a couple of blueprints below for your review:

Default blueprint:

<?php if(!defined('KIRBY')) exit ?>

title: Page
pages: true
files: true
fields:
  title:
    label: Title
    type:  text
  text:
    label: Text
    type:  textarea

Custom blueprint for another page:

<?php if(!defined('KIRBY')) exit ?>
title: Instructor
pages: false
files:
  sortable: true
  type: image
icon: user
fields:
  title:
    label: Name of Instructor
    default: > 
      Enter Instructor Name 
    entry: >
      {{instructor}}
  instructor:
    label: Instructor Details
    type: structure
    entry: > 
      <h2>Instructor Details</h2>
      Name: {{instructor}}
      <br>
      <h3>Contact Info</h3>
      E-mail: {{email}}<br>
      Phone: {{phone_number}}<br>
      Course Currently Teaching or Taught: <a href='/calendar/events/{{classes_taught}}'>{{classes_taught}}</a>
      <br>
    fields:
      instructor: 
        label: Instructor Name (first and last)
        type: text
        icon: user
        required: true
      email:
        label: E-mail Address
        type: email
        autocomplete: false
        required: true
      phone_number:
        label: Phone Number
        type: tel
        autocomplete: false
        required: true
      classes_taught:
        label: Classes Currently Teaching or Taught
        type: multiselect
        options: query
        query: 
            page: events
            fetch: pages
            template: event
            text: '{{title}}'
            value: '{{uid}}'

Any ideas?

These blueprints both look good*. Is there a blueprint that has a field with the label “Options”?

* Not relevant for this issue, but there is no entry option for the title field. You can remove that one.

Running a search through all of my blueprints with the search term “options” revealed that I have two blueprints where the label “Options” appears as part of a query structure, like so:

Instructor Blueprint:

instructor:
      label: Select an Instructor
      type: select
      options: query
      width: 1/4
      required: true
      query:
        page: events/instructors
        fetch: children
        text: '{{title}}'
        value: '{{uid}}'

But that’s pretty standard, isn’t it? Do you need me to provide a copy of the other instances of “Options” in my blueprints?

That looks ok, from the error message it looks as if there was a key with a missing value somewhere, but maybe the error message is misleading.

Another thing: Have you made sure that Kirby/Toolkit and the Panel are on the same version? Do you use any custom fields?

Not a key/label of “options”, but a “label: Options” value.

The error is from the YAML parser, so it’s most likely a blueprint issue.

@texnixe, checked to ensure both the Kirby/Toolkit and Panel are on the same version- they are. Everything’s on 2.2.3. I do use a lot of custom fields, are there specific naming conventions I should be aware of when creating my custom fields?

@lukasbestle, your suggestion about the label:“Options” seems to be the solution! Yes, it was definitely a blueprint issue. I had a Gallery blueprint that was no longer being used as I pushed the gallery feature into a subpage element, and the Gallery blueprint had a Label:“Options” reference that caused this whole issue. See below:

<?php if(!defined('KIRBY')) exit ?>

title: Gallery
pages: false
icon: camera-retro
files:
  type:
    - image
      icon: picture-o
  sortable: true
fields:
  title:
    label: Title
    type:  text
  galleryImages:
    label: Gallery Images
    type: checkboxes
    options: images
  galleryOptions:
    label: Options:
    type: radio
    default: cover
    options:
      cover: Use first image as cover image.
      thumbs: Show gallery as thumbnails.

I deleted this blueprint, as I’m no longer using this approach for my picture galleries, but man, your solution worked like a charm. I’ll make sure going forward that no labels are set to Options: but instead appear as “Options:”.
Might be helpful if you could post a brief explanation as the solution for other readers / users of Kirby encountering this issue.

Many thanks, @texnixe and @lukasbestle! You guys have been so helpful!

1 Like

Yes, the problem is the colon after Options. The Parser thinks it is a new field, therefore you have too many keys.

Great, simple enough explanation. Marked this as Solved! Thanks again, you two!

If anyone else has this issue: The following would work:

label: "Options:"
1 Like