[MGNLUI-4168] FieldDefinitionKeyGenerator#getParentName should emit log messages less severe than warnings Created: 20/Mar/17  Updated: 27/Mar/17  Resolved: 21/Mar/17

Status: Closed
Project: Magnolia UI
Component/s: None
Affects Version/s: 5.5.2
Fix Version/s: 5.5.3

Type: Bug Priority: Neutral
Reporter: Aleksandr Pchelintcev Assignee: Aleksandr Pchelintcev
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Relates
relates to CONTEDIT-57 FieldDefinitionKeyGenerator produces ... Closed
relates to MGNLUI-4169 Simplify FieldDefinitionKeyGenerator'... Open
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
Epic Link: Initial Article editor
Sprint: Basel 88
Story Points: 2

 Description   

Currently when field's keys are populated, the generator walks from parent to parent and collects their names (via FieldDefinitionKeyGenerator#getParentName which merely attempts to call a getName() method). Under certain circumstances, some parents in such chain may not produce the name for some reason.

One example could be a ContentDefinition:

@I18nabe
public class ContentDefinition {

    private List<FieldDefinition> outlineFields;
    private String defaultBlock;
    private List<String> blocks;

    public List<FieldDefinition> getOutlineFields() {
        return outlineFields;
    }

    public void setOutlineFields(List<FieldDefinition> outlineFields) {
        this.outlineFields = outlineFields;
    }

    ...
}

Such definition is included in an article editor sub-app descriptor and delivers such information as block identifiers and also the collection of the outline field definitions. Those fields should be i18n-izable and sufficient keys could look like <app>.<sub-app>.<rest-of-field-key>. All works fine except for ContentDefinition does not provide its name which results in a warning similar to the following:
..:Cannot obtain name of parent object: info.magnolia.editor.content.ContentDefinition$$EnhancerByCGLIB$$614a4d1b.getName().
We don't care about the content definition's name and field key generator doesn't fail on its absence - only emits the warning and moves on.

Shouldn't we just lower the severity of the log statement to debug for such cases?


Generated at Mon Feb 12 09:13:57 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.