Strange structure behaviour in 2.3.2

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

For structure fields not, for all other field types yes. :slight_smile:
That’s just an issue that can’t be solved within the core as the core doesn’t know about field types. That’s why the Panel would need to set the value on save.

Yes, the ā€œproblemā€ with the structure field is that as a whole, it is a field, but the ā€œsubfieldsā€ are not fields themselves for Kirby.

The same behaviour described in the first post happens with 2.5.2. So I started a new topic