Skip to content
This repository was archived by the owner on Oct 6, 2022. It is now read-only.
This repository was archived by the owner on Oct 6, 2022. It is now read-only.

AutoID changed after saving page #69

@frankmichel

Description

@frankmichel

I am not sure what's going on here and if this is expected behaviour. I have a blueprint with basically the following fields configuration:

years:
  label: Years
  type: structure
  sortBy: name asc
  sortable: false
  translate: false
  fields:
    name:
      type: text
    autoid:
      type: hidden
      translate: false

events:
  label: Events
  type: structure
  sortBy: name asc
  sortable: false
  translate: false
  fields:
    name:
      type: text
    year:
      type: select
      options: query
      query:
        fetch: page.years.toStructure
        text: '{{ structureItem.name }}'
        value: '{{ structureItem.autoid }}'
    autoid:
      type: hidden
      translate: false

So basically I am using the structure years to populate the options which are available in the events structure. In reality these two structures are on two different tabs, but on the same page. And I think this is part of the problem since the blueprint example is exactly the same, but on two different pages.

Screenshot 2021-10-29 at 17 30 34

So, when I add a year to my years structure and save the page everything looks fine and the content file gets the new values with an autoid:

Screenshot 2021-10-29 at 17 31 55

However, after changing anything else on the same page and then saving the page again (without reloading) the autoid of the previously saved year will be changed behind the scenes. This causes some issues when trying to use the newly created year in the events structure on the same page. A newly created year will be available to be selected as an option, and it will look perfectly when saving the events structure.

Screenshot 2021-10-29 at 17 43 04

But after reloading the page, the year will be empty since the autoid of the year has been changed. I have no idea why the autoid is changing once it has been previously saved. Is there a way to prevent the autoid from being updated/changed once it has been saved?

Screenshot 2021-10-29 at 17 35 26

The autoid has magically changed:
Screenshot 2021-10-29 at 17 35 51

The problem will not occur whenever I do the following:

  1. add the year to the years structure
  2. save the page
  3. reload the panel
  4. add an entry with the newly added year to the events structure
  5. save the page

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions