Array_key_exists() expects parameter 2 to be array, string given (Kirby-builder)

#1

I’m using the kirby-builder plugin from @timoetting but getting the error mention above in the panel. Any ideas as what it means and how to get rid of it?

#2

Could you please post your blueprint?

#3
    columns:
     - width: 1/1
      fields:
      # inside the fields section of your blueprint:
        mybuilder:
          label: Page Builder
          type: builder
          columns: 1 # Optional. If set to 2 or more, the builder blocks will be placed in a grid.
          max: 10 # Optional. Limits the number of builder blocks that can be added.
        fieldsets:
          quote: # This is a field set. It contains a group of kirby fields. The user can select from these sets to build the content.
            label: Quote
            preview: # Optional. If defined, a preview of the block can be rendered by the specified snippet from within the snippets folder.
              snippet: blocks/quote
              css: /assets/css/blocks/quote.css
            fields:
              text:
                label: Quote Text
                type: textarea
              citation:
                label: Citation
                type: text
          bodytext:
            label: Text
            tabs: # Optional. Tabs can be used to group the fields of a field set. In this example, we use one tab to contain the content related fields and one for styling settings. It makes no difference for the content handling in the template if there are tabs or not.
              content:
                label: Content
                icon: edit # Optional. This icon appears next to the tab. The icon name can be chosen from the Kirby's icon set getkirby.com/docs/reference/ui/icon
                fields:
                  text:
                    label: text
                    type: textarea
              style:
                label: Style
                icon: cog
                fields:
                  fontfamily:
                    label: Font
                    type: select
                    options:
                      helvetica: Helvetica
                      comicsans: Comic Sans
                  fontsize:
                    label: Font Size
                    type: number
          events:
            label: Events
            preview:
              snippet: blocks/events
              css: /assets/css/blocks/events.css
            fields:
              eventlist: # The Builder Field can even be nested!
                type: builder
                label: Event List
                columns: 2
                fieldsets:
                  event:
                    label: Event
                    fields:
                      title:
                        label: Title
                        type: text
                      text:
                        label: Description
                        type: textarea
                      date:
                        label: Date
                        type: date
          calltoaction:
            #extends: blocks/calltoaction
#4

Your indentation looks wrong, the field sets should be indented…, also, columns and max currently don’t seem to work

#5

Thanks for the quick reply. I did copy the code directly from the repo. I think when I pasted it here it didn’t intent correctly

#6

The code from the readme throws the error mentioned in the thread I linked to, you have to remove the max and column settings to make it work. After removing them, it should work.

#7

Ok I removed columns and width but now get ’ The field type “mybuilder” does not exist’

#8

Please make sure that your indentation is correct, exactly like in the readme.

#9

I’ve created a new .yml page with only the blueprint code from the readme file minus the column and width, and still weirdly get the same error :frowning:

#10

Don’t remove the columns and width, but the maxand columns setting from after type: builder.

#11

My apologies I meant max and columns.

#12

Hey @ivorthedesigner,

the problem with your blueprint are the last two lines. You start a new fieldset calltoaction but leave it empty because the following line is commented out. Make sure to comment or delete the line calltoaction aswell

#13

@timoetting I had removed that those lines when I tested, but strangely can’t reproduce the error now. Maybe there was still something in the cache after removing.