Uploaded image for project: 'Magnolia UI'
  1. Magnolia UI
  2. MGNLUI-4168

FieldDefinitionKeyGenerator#getParentName should emit log messages less severe than warnings

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Neutral
    • 5.5.3
    • 5.5.2
    • None
    • None

    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?

      Checklists

        Acceptance criteria

        Attachments

          Issue Links

            Activity

              People

                apchelintcev Aleksandr Pchelintcev
                apchelintcev Aleksandr Pchelintcev
                Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:

                  Checklists

                    Bug DoR
                    Task DoD