Migration from v2 - files field don't save

Hello,

I have migrated a homepage from v2 -> v3.3.
Almost everything worked except that I have problems on already existing pages images with the files field are not saved.
I can select the image in the fiels field and save the changes, but if I make a reload, the selection is no longer saved. When I create a new page, that does not happen.

What did I try?

The file permissions are reset
Deleted the thumb folder
The Thumsdriver changed: ‘driver’ => ‘im’,

However, that does not help.

My Blueprint:

title: Default
icon: page

pages:
  template: default

options:
  preview: false
  changeTemplate: false


columns:
  # main
  main:
    width: 2/3

    sections:
      drafts:
        headline: Draft
        type: pages
        status: draft
        layout: list
        template: page
        empty: No events yet
        sortBy: date desc
        info: " {{ page.title }}"
        text: " {{ page.title }}"
        image: false

      published:
        headline: Published
        type: pages
        layout: list
        status: published
        template: page
        empty: No events yet
        sortBy: from desc
        info: " {{ page.title }}"
        text: " {{ page.title }}"
        image:
          query: page.cover.toFile
          ratio: 1/1
          cover: true
      
      content:
        type: fields

        fields:

          show_in_home:
            label: Should this page appear on the homepage ?
            type: toggle
          home_categorie_image:
            label: image
            type: files
            multiple: false
            query: page.images
            max: 1

  # sidebar
  sidebar:
    width: 1/3
    sections:

      # a list of files
      files:
        type: files
        headline: Files

My config:

<?php

return [
    'debug' => true,
    'panel.install'=> true,
    'languages' => true,

  'community.markdown-field.buttons' => ['headlines', 'bold', 'italic', 'divider', 'link', 'email', 'pagelink', 'file', 'divider', 'ul', 'ol'],
  'community.markdown-field.font' => [
    'family'  => 'sans-serif',
    'scaling' => false,
    'size'    => 'regular',
  ],

  'community.markdown-field.modals' => true,
  'community.markdown-field.blank' => false,
  'community.markdown-field.invisibles' => false,


  'thumbs' => [
    'driver' => 'im',
    'autoOrient' => true
  ],

 'hooks' => [
     'page.duplicate:after' => function ($duplicatePage) {
            if($duplicatePage->template() == "news")
            {
              try {

                    $dateNow = date_create()->format('Y-m-d H:i');
                    $newcontent = $duplicatePage->update([
                    'article_title' => 'new title',
                    'created' => $dateNow
                    ]);

                    

                  } catch(Exception $e) 
                  {

                    $e->getMessage();

                  }
            }
        }
 ]
 

];

Did the field already exist in your old blueprint?

Yes, and others I do not need anymore

The new files field stores stuff in yaml format, so that might be causing issues

I have deleted the contents of the xyz.de.txt file except the title and then tried again to save the image in the files field — without success. However, I can change and save the title without any problems. So it must have something to do with the pictures or not?

Can you save other pages without image field?

yes and create new pages with and without image field

But you cannot store a selected file even when you create a new page? Seems strange

No when I create a new page I can save all fields.

Hm, have you tried to delete localStorage and restart the Panel? Deleted the media folder etc?

Yes.
If I delete the child pages I can save the files field. Is something wrong in my blueprint?

title: default
icon: page

pages:
  template: default

options:
  preview: false
  changeTemplate: false


columns:
  # main
  main:
    width: 2/3

    sections:
      drafts:
        headline: Draft
        type: pages
        status: draft
        layout: list
        template: page
        empty: No pages yet
        info: " {{ page.title }}"
        text: " {{ page.title }}"
        image: false

      published:
        headline: Published
        type: pages
        layout: list
        status: published
        template: page
        empty: No events yet
        info: " {{ page.title }}"
        text: " {{ page.title }}"
        image: false

      
      content:
        type: fields

        fields:

          home_categorie_image:
            label: image
            type: files
            multiple: false
            query: page.images

          show_in_home:
            label: Should this page appear on the homepage ?
            type: toggle

  # sidebar
  sidebar:
    width: 1/3
    sections:

      # a list of files
      files:
        type: files
        headline: Files

The pages/template setting at the top doesn‘t make sense, but I wonder if that’s really what’s causing this

that is the file structure

That looks ok, but as i said, remove the pages settings from the top of the blueprint, that’s a Kirby 2 setting

My solutions is to make duplicates from the “old” pages and than it works.
But I do not understand what I do wrong.

PS: other question

Is this okay ?

title: Page
icon: page
preset: page
pages: false

to overide the “add pages” in the sidebar ?

Yep, that’s correct.

Nor do I.:woman_shrugging:

It seems like preset: page always has the side bar.

But in general your blueprint seems mixed with old and new syntax and you are using some plugins, are they compatible with the new kirby version? I would try to read the docs and build it again adding little by little the modifications to fit my needs.

It took me a bit to get the hang of the new blueprint, but the docs are really clear and useful.