[MGNLFORM-388] Hidden form fields are not i18n enabled Created: 31/Jan/23  Updated: 03/Mar/23  Resolved: 03/Mar/23

Status: Closed
Project: Magnolia Form Module
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Neutral
Reporter: Antony Hutchison Assignee: Mercedes Iruela
Resolution: Not an issue Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:
Epic Link: AuthorX Support
Team: AuthorX

 Description   

Steps to reproduce

  1. Create a form on a multilingual site
  2. add a hidden field
  3. edit hidden field and try to set a different value per language

Expected results

Most (all?) of the other form fields can have translated values, so it's reasonable to expect 'hidden' to also have the capacity to have translated values (we want to use this to pass language as a parameter to the form processor)

Actual results

There's no language selector in the edit dialog.

Workaround

We've tried to use decoration to add i18n=true to the field value, but without success - it refuses to apply the decoration. I can't tell if this is my fault, or if it's not possible to decorate dialogs, or if it's because the dialog is bootstrapped into config rather than part of a lightmodule.

Development notes

It should be as simple as adding i18n:true to formHidden.yaml for the 'value' field.



 Comments   
Comment by Raphael Falvo [ 03/Feb/23 ]

Hello ahutchison , can you please let us know which version of the module you are actually using? Thanks.

Comment by Antony Hutchison [ 03/Feb/23 ]

Hi Raphael. We're using latest, version 2.7.7.

Comment by Luke Trueman [ 07/Feb/23 ]

Hi Antony, just to check, when you tried to decorate the dialog, did you add a module descriptor to ensure your light module with the decoration applies after the forms module has loaded?

Comment by Antony Hutchison [ 07/Feb/23 ]

Hi Luke,

I added the `form` entry to try and resolve this.

OLD:

version: 1.0
dependencies:
  mtk2: 
    version: 2.0/*

NEW:

version: 1.0
dependencies:
  mtk2: 
    version: 2.0/*
  form:
    version: 2.7/* 

No noticable effect was observed.

Comment by Luke Trueman [ 08/Feb/23 ]

Thank you - rfalvo anything else Antony can try? 

Comment by Mercedes Iruela [ 03/Mar/23 ]

Hello Anthony,

Excuse me for the late answer, it is easier for us to provide quicker support when you create tickets directly in HD instead of reporting the issue directly in the public projects.

I tried to decorate formHidden in our demo bundle and I found no issues, my decoration is like:

/<LIGHT_MODULE>/decorations/form/dialogs/formHidden.yaml
form:
  tabs:
    tabMain:
      fields:
        value:
          i18n: true

Could you please create a ticket in HD so you can share with us your code and we can continue with the research.

Thanks!

Comment by Antony Hutchison [ 03/Mar/23 ]

Thanks Mercedes. I'll try again with this YAML, and if there's still a problem I'll open a request in HD. We can close this Jira task - there's no further action needed here.

Generated at Mon Feb 12 05:39:42 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.