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

Ctrl + S in structure field containing date fields clears content #6390

Open
bezin opened this issue Apr 11, 2024 · 3 comments
Open

Ctrl + S in structure field containing date fields clears content #6390

bezin opened this issue Apr 11, 2024 · 3 comments
Labels
needs: information ❓ Requires more information to proceed

Comments

@bezin
Copy link
Contributor

bezin commented Apr 11, 2024

Description

I have a custom block with a structure field, that has several fields (text, color, list, two date fields)
When I edit a structure item and hit CTRL+S, the structure form is closed and I see the editing mask for the block again, but all content is gone – at least visually. When I close the drawer and save the changes, everything works as expected (the content is still there incl. my intentionally made changens).

This does not happen, when I exclude the date fields. However, the changes I made were not in the date fields, but in a text field.

Expected behavior
I expect CTRL+S to close the structure field edit mask and return to the block edit mask without loosing the content.

Your setup

Kirby 4.2.0 on PHP 8.3, running on Ubuntu in WSL (Windows 11) with Symfony Webserver

@distantnative
Copy link
Member

@bezin Could you please share your blueprint?

@distantnative distantnative added the needs: information ❓ Requires more information to proceed label May 1, 2024
@bezin
Copy link
Contributor Author

bezin commented May 3, 2024

Sure thing, here you are:

# site/blueprints/blocks/timeline.yml
name:
  en: Timeline
  de: Zeitleiste
fields:
  headline:
    label:
      en: Headline
      de: Überschrift
    type: text
    width: 1/2
    required: true
  phases:
    label:
      en: Project phases
      de: Projektphasen
    columns:
      title: true
      color: true
      from: true
      till: true
    type: structure
    fields:
      title:
        type: text
        required: true
        width: 1/2
      color:
        label:
          en: Color
          de: Farbe
        type: color
        required: true
        width: 1/2
      from:
        label:
          en: From
          de: Von
        type: date
        calendar: false
        required: true
        width: 1/2
      till:
        label:
          en: Till
          de: Bis
        type: date
        calendar: false
        required: true
        width: 1/2
      objectives:
        type: list
        required: true

When you use it like this, ctrl + s clears the data in the view. However, when you uncomment from and till (both, one is not enough), everything works as expected.

@Afplaktape
Copy link

Afplaktape commented May 23, 2024

I ran into the same problem with this blueprint. While working in the nested structure, it overrides structure 1 when I'm in a field and press cmd+s.

title: Nested structure

fields:
  structure1:
    type: structure
    label: Structure 1
    fields:
      title:
        type: text
      structure2:
        type: structure
        fields:
          title:
            type: text
          date:
            type: date
            default: today

PHP: 8.3.7
Kirby: 4.2.0

Edit: When I remove the datefield, everything works the way it should work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs: information ❓ Requires more information to proceed
Projects
None yet
Development

No branches or pull requests

3 participants