getkirby / kirby

Kirby's core application folder
https://getkirby.com
Other
1.31k stars 168 forks source link

Sorting number prefix changes when saving secondary languages #1886

Closed REHvision closed 5 years ago

REHvision commented 5 years ago

Describe the bug

When using date based sorting for blog articles num: date will use the date field's value as sorting number prefix on publishing (and the current date if the date field is empty or not present)

This works as expected in a single language setup and when saving/updating the primary language in a multi-language setup.

But whenever I edit a page in a secondary language and save it, the sorting number prefix of that page/folder also changes in one of the following ways:

Since in most cases you wouldn't want the date field translated, translate: false is the desired behavior here.

To Reproduce

Steps to reproduce the behavior:

  1. Download + install a fresh Starterkit
  2. Activate languages + add at least one secondary language
  3. Open a "note" in the Panel
  4. Switch to the secondary language
  5. Edit the date field
  6. See the folder sorting prefix changed according to the secondary language's date

Additionally:

  1. Add translate: false to the date field in note.yml
  2. Edit any field in the secondary language of a note and hit save
  3. See the folder sorting prefix changed to alphabetically 0_

Expected behavior

The folder name with sorting prefix represents the primary language's sorting and slug! A translated slug is stored in the content file already and not renaming the folder.

The sorting number should follow the same rules and NEVER change based on secondary language changes!

If different sortings between languages is necessary or desired, it should only be stored in the content file, too.

Kirby Version

3.2.0

bastianallgeier commented 5 years ago