Uploaded image for project: 'Magnolia Personalization'
  1. Magnolia Personalization
  2. MGNLPN-641

EditComponent uses deprecated constructor which does not inject LanguageSelectorView

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Neutral
    • 2.1.4
    • None
    • None
    • None

    Description

      Description

      When creating / editing a component, the EditElementAction is called but the constructor call discriminates between if you are creating or editing a component.

      If you create a new component, the default constructor is used which injects the LanguajeSelectorView object, so if you have a custom implementation of this class, it will be passed and used:

      On this point, everything works smoothly. But if you edit the component, then the Deprecated constructor is used which has no LanguageSelectorView parameter and nothing is passed:

      So the component is a built with a null LanguageSelectorView object:

      Once you have modified the component and try to save it, the getCloserHandler is called, it fails with a nullPointer because the LanguageSelectorView object is truly a null:

      Expected result

      The editComponent uses the non deprecated constructor, which passes the LanguageSelectorView object

      Actual result

      The editComponent uses the deprecated constructor, which does not inject the LanguageSelectorView object, so the closerHandler fails with a nullPointer

      Dev notes:

      Full stacktrace attached

      Checklists

        Acceptance criteria

        Attachments

          1. 1.Creating-component.png
            1.Creating-component.png
            459 kB
          2. 2.Edit-component-1.png
            2.Edit-component-1.png
            764 kB
          3. 3.Edit-component-2.png
            3.Edit-component-2.png
            583 kB
          4. 4.Close-null.png
            4.Close-null.png
            342 kB
          5. stacktrace-languagueSelector
            15 kB

          Activity

            People

              mdivilek Milan Divilek
              ccantalapiedra Carlos Cantalapiedra
              DeveloperX
              Votes:
              2 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Checklists

                  Bug DoR
                  Task DoD