Weird Panel error on first save

I’ve encountered this strange alert in my local installation of Kirby (2.5.5) trying to edit a page in the panel.
The blueprint is really simple, so I don’t know how to remove in order to find the problem.

Blueprint anno.yml, the title is numeric (eg. 2017):

title: Anno

files: false

pages:
  template: anno-item

fields:
  title:
    label: Title
    type:  text

  date:
    icon: calendar
    label: Data dell'edizione
    type: text
    required: true
    width: 3/2

  text:
    label: Text
    type: textarea

Thanks in advance (:

Could you provide the child blueprint please, as far as I can see the error occurs on the anno-item blueprint. It’s very likely an error in your blueprint…

Of course, this is anno-item.yml:

title: Progetto

files:
  sortable: true

pages: false

fields:
  title:
    label: Title
    type: text
    width: 3/4
    help: Nome dello studio

  event:
    label: Nome dell'evento
    type: textarea
    help: Apparirà nella barra laterale

  text:
    label: Text
    type:  textarea

Hm, the blueprint looks alright. Does this happen only with this blueprint? Does this happen with all pages that use this particular blueprint?

Have you tried to log out and in again and clear the browser cache?

If all else fails, try to recreate the blueprint from scratch.

It’s weird because yesterday I’ve created three subpages with the anno-item.yml blueprint.
The error shows off only on one page. Initially, I thought that the problem was the accent È on the title of this page (the only difference I’ve spot), but today the error has appeared on a brand new installation.

After some other tests, I’ve found out that the problem is the hyphen.
Replacing anno-item in anno_item has solved my problems.

I don’t know why I often avoid underscore or camelCase for blueprint and template names, but obviously it’s a very bad idea.

You shouldn’t use camelCase in file names, underscores and hyphens should be ok, and personally, I have never had problems with hyphens in blueprint names, but I think we had a similar issue before.

Unfortunately the problem is not solved.

I’ve copied the same text (inside the Text textarea) to three subpages, and after trying to save the last one, I’ve encountered the same old error.

After logging out and clearing the browser cache everything seems ok, but then I’ve uploaded an image and the panel is broken again.

Even though you renamed the blueprint to something without a hyphen?

Exactly, no hyphen…

Could you paste the content of the txt file that causes the error? Or rather, is the content saved despite the error message?

Which PHP version are you using?

PHP 7.1.7
I’m using Laravel Valet as development environment, but the same error occurs with the macOS build-in server.

This is the whole txt file:

Title: 24C— Èurema interni

----

Event: 

Davide Groppi
Una Grande Luce

----

Text: Èurema tota incipsant fugitatem ea cus dolent faccum re as ut omnimint, velit et poreptae vellate volorro esed qui blaut occatem endit, qui dolupta tendae lantotatia qui odit, ium, omnis volent quuntur, conem volorporibus delenti berovid ucimento consenecto eum voloraeri dolo oditas repudi cuptat offictatia voluptis quis et as netur re cullor sitatiandi denditecae parum consequiat ut rere corum eveliberum sum inistias quat aces et eos dolest eum dollorae saped molor sinti doluptas inimusam comnimu saesciis et qui conserum faccatur, odis re peliquo officiis con perum faccumquas estia placid est quia doles.

After uploading (succesfully) an image, I’ve chosen it from the main_image select I’ve added to the blueprint.
The new field is not being saved in the txt file.

This is the updated blueprint I’m working on:

title: Progetto

files:
  sortable: true

pages: false

fields:
  title:
    label: Title
    type: text
    width: 3/4
    help: Nome dello studio

  main_image:
    label: Immagine principale
    type: image

  event:
    label: Nome dell'evento
    type: textarea
    help: Apparirà nella barra laterale

  text:
    label: Text
    type:  textarea

I could finally reproduce this issue. It seems to me that the fieldname event seems to be the problem. Could you please test if the issue disappears if you rename this field? The strange thing is that the issue only seems to appear if you fill in the second field. Seems to be some sort of clash with the event method in the page class.

Edit: I created an issue on GitHub:

Yes, after renaming the fieldname everything works as expected :tada:

Thank you so much for your help, you’re the best!

1 Like