[MAGNOLIA-4388] i18n wrapper doesn't return value for alternative language when default language value is not defined Created: 25/Apr/12  Updated: 26/Jul/12  Resolved: 26/Apr/12

Status: Closed
Project: Magnolia
Component/s: i18n
Affects Version/s: 4.5.2
Fix Version/s: 4.5.3

Type: Bug Priority: Critical
Reporter: Jan Haderka Assignee: Federico Grilli
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
causality
is causing MAGNOLIA-4494 I18nNodeWrapper incorrectly treats no... Closed
is causing MAGNOLIA-4433 Templating samples don't render images Closed
relation
is related to MAGNOLIA-4387 Navigation title of other languages i... Closed
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:

 Description   

Whend value of the property is not defined in default language, it won't be visible also for alternative languages.
To reproduce:

  • in article page, remove value of abstract for default (english) language
  • switch editing language to german
  • add german value for abstract
  • result: german value is not displayed unless there is also value for abstract in english


 Comments   
Comment by Federico Grilli [ 26/Apr/12 ]

Turned out that info.magnolia.jcr.util.PropertyUtil.getString(Node, String, String) is called by a bunch of STKTemplatingFunctions methods. In there the wrapped node is probed for the existence of a given property. Now, in this case no default is present but only a locale variation (eg, 'foo_de' is there but not 'foo') so wrappedNode.hasProperty("foo") would return false. However, when wrapped node is an instance of I18nNodeWrapper it obviously has to take into account the possibility that no default is defined and still there's a locale variation of it.

Generated at Mon Feb 12 03:55:18 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.