[MGNLUI-2236] Label of subapps is ignored Created: 04/Oct/13  Updated: 22/Oct/13  Resolved: 21/Oct/13

Status: Closed
Project: Magnolia UI
Component/s: None
Affects Version/s: 5.1
Fix Version/s: 5.1.1

Type: Bug Priority: Neutral
Reporter: Jaroslav Simak Assignee: Jozef Chocholacek
Resolution: Cannot Reproduce Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File m01.png     PNG File m02.png    
Issue Links:
causality
caused by MAGNOLIA-5350 An i18n text (label, description, ...... 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:
Epic Link: i18n Epic
Sprint: 5.1.1

 Description   
Version number : 5.1 (Snapshot: 2013.10.04 08:02:58)
Build          : 4. October 2013 (rev. a33e11d74c2fa8d08268293854dd38e7556a35f3)
Edition        : Enterprise Edition

Steps to reproduce:

  • go to configuration/modules/about-app/apps/about/subApps/main
  • add property label and set its value
  • open about app
  • label hasn't changed to the one defined in the subapp

See also attached screenshots.

Debugging leads to the getCaption() method in the info.magnolia.ui.framework.app.BaseSubApp.

    /**
     * This method will try to determine the current sub app caption, the one usually displayed in the tab where the subapp opens.
     *
     * @return the configured label for this subapp. If no label is found in the subapp configuration, it will try to use the label from the parent app.
     *         If the latter is missing too, it will return an empty string.
     */
    @Override
    public String getCaption() {
        String label = subAppContext.getSubAppDescriptor().getLabel();
        if (StringUtils.isNotBlank(label)) {
            return label;
        }
        label = subAppContext.getAppContext().getLabel();
        if (StringUtils.isNotBlank(label)) {
            return label;
        }
        log.warn("No label could be found for sub app [{}] in app [{}]", subAppContext.getSubAppDescriptor().getName(), subAppContext.getAppContext().getName());
        return "";
    }

String label = subAppContext.getSubAppDescriptor() returns proxied subapp descriptor that then returns label of the main app, not subapp (btw getLabel() method in the subapp gets invoked and returns correct label).



 Comments   
Comment by Jozef Chocholacek [ 08/Oct/13 ]

As stated in MAGNOLIA-5350 it's not just about sub apps labels, but all i18n enabled properties.

Btw. you shouldn't specify "hardcoded" text as a label - rather a key, and then define a value for such key in the message bundle.

Comment by Jozef Chocholacek [ 21/Oct/13 ]

Solved with the MAGNOLIA-5350

Generated at Mon Feb 12 08:54:31 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.