Strange structure behaviour in 2.3.2

Hello,

i have experienced some strange behaviour while adding structure field entries in panel:

  • i have 2 languages “de”(default) and “en”.

  • i create a page and some structure field elements.

  • after saving and switching the language to “en” i see the structure entries.

  • going back to “de”

  • adding another structure field element.

  • save

  • switch to “en”

  • added entry not visible in “en” !?

  • deleting all structure entrys in “en” view

  • hit save

  • all entries from “de” (the default language) are back again (as expected)

maybe it is a cache problem?

S.

Yes, this is most likely cache related, I can reproduce this. Will check with 2.4.0 beta.

1 Like

I have created an issue on GitHub.

Thank you! :heart_decoration:

I also found some glitches with “untranslated” fields.

If i iopen up a structure entry in the non default language for the first time it looks like this:

After saving it and reopening it looks like this:

The untranslated settings are gone… why?

How can i get a structure element in a template in a non default language filled up with the untranslated/global values from the default language?

E.g. i am in a "en"glish view, “de” is the default and there are some fields with the “translate:false” setting. This fields should be “merged” to the “en” page object? How?

best Regards,
Sven

Hm, I can’t reproduce this. Could you please post your blueprint for testing? And maybe a step by step instruction on how to reproduce this?

Sure. Here it is:

title: Formular
pages: true
files: true
fields:
  title:
    label: Title
    type:  text
  text:
    label: Text
    type:  textarea

  ffields:
    label: Formular
    type: structure
    #style: table
    modalsize: large
    entry: >
      <u><b>{{_fieldtype}}&nbsp&nbsp</b></u>&nbsp;&nbsp;&nbsp;Name: <i>{{_fieldname}}</i>&nbsp;&nbsp;&nbsp;ID: <b>{{_fieldid}}</b> 
    fields:
      _fieldtype:
        width: 1/3
        required: true
        translate: false
        label:
          de: Eingabetyp
          en: Field type
        type: select
        options:
          _text: Text
          _textarea: Textarea
          _radio: Radio
          _check: Checkbox
          _select: Selectbox
          _submit: Submit button
          _layout: Layout
          _info: Info text
      _fieldname:
        width: 1/3
        label:
          de: Feldname
          en: Field name 
        type: text
      _fieldid:
        width: 1/3
        label:
          de: Feld-ID
          en: Field id
        type: text
        translate: false
      _visibility:
        label:
          de: Sichtbarkeit
          en: Visibility
        type: checkboxes
        translate: false
        width: 2/3
        #default: _visible
        options:
          _visible:
            de: Unsichtbar
            en: Invisible
      _fieldmeta:
        label:
          de: Feld Meta Daten
          en: Field meta data
        type: textarea
  • create a entry in default language
  • save
  • change to non default language
  • open the entry
  • save
  • open again
    -> non translated values are gone

It doesn’t matter whether is saved to the non default languages untranslateble fields… on the template i need a “merged” version for the selected language… the data from the default language merged/partly overwritten with the current selected language. How can i do this programmatically?

I’ll try to look into this asap. My first test did not even show the entry in the English view …:confused:

Yes, this is the problem i reported above.

Thank you!

Here is a screen recording of the issue:

I have created another issue on GitHub. Unfortunately, I can’t test this in Kirby 2.4.0 beta because of another issue.

1 Like

Thank you!

I hope it is fixable soon because my project(s) rely heavily on the structure and translation features.

best regards,
Sven

It just seems strange that this issue hasn’t surfaced earlier. Did it work in a previous version of Kirby?

I don’t know. In what version the “translate:false” blueprint option was introduced?
Where can i get this old versions starterKit?

S.

Maybe the behaviour is intentional after all:

Since Kirby 2.2.3, the contents of an untranslatable field will be emptied in all languages but the default language.

https://getkirby.com/docs/panel/blueprints/form-fields#prevent-field-values-in-non-default-languages

Hm, it seems so.

But how can i “merge” the data on a template?

S.

That should be automatic, as Kirby falls back to the default language if the value of the non-default language is empty.

Should but want do it here. I get NULL for all untranslateble fields:

<?php $ffields = yaml($page->ffields());var_dump($ffields); ?>

gives me:

  [6]=>
  array(5) {
    ["_fieldtype"]=>
    NULL
    ["_fieldname"]=>
    string(8) "Das Info"
    ["_fieldid"]=>
    NULL
    ["_visibility"]=>
    NULL
    ["_fieldmeta"]=>
    string(22) "Das ist ein Info Text."
  }
  [7]=>
  array(5) {
    ["_fieldtype"]=>
    NULL
    ["_fieldname"]=>
    string(4) "Send"
    ["_fieldid"]=>
    NULL
    ["_visibility"]=>
    NULL
    ["_fieldmeta"]=>
    string(0) ""
  }

Also the invisibility of untranslateble values from default language in the panel looks very strange. it would be nice if the grayed out fields display the values from the default language even if they will be emptied at save.

As far as I know, content is not inherited inside structure fields. Only the whole field is inherited if it’s completely empty. So this is indeed a bug.

Inheriting the whole field only if the field is completely empty makes no sense at all. :frowning:

Yes, I agree with you.

1 Like