getkirby / kirby

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

Untranslatable fields are overly sensitive to Blueprint field's key capitalization #2577

Closed neildaniels closed 2 years ago

neildaniels commented 4 years ago

Describe the bug
Programmatically updating a model with untranslatable fields can lead to unwanted results if your code specifies a different key case from those in a Blueprint.

To Reproduce
Steps to reproduce the behavior:

  1. Start with a Blueprint with a field like:
    SOMEID:
    type: text
    translate: false
  2. Programmatically create a page with content resembling:
    [
    'someid' => 'myidentifer'
    ]
  3. Programmatically update the content for a non-default language
    $page->update(`['foo' => 'bar'], 'fr-fr);
  4. The resulting translation's content will resemble:
    [
    'someid' => 'myidentifier',
    'foo' => 'bar',
    'SOMEID' => null,
    ]

Expected behavior I would expect the resulting content to not include 'myidentifier'.

[
  'someid' => null,
  'foo' => 'bar',
]

Kirby Version
3.3.5

bastianallgeier commented 2 years ago