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

EditComponent uses deprecated constructor which does not inject LanguageSelectorView

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Neutral Neutral
    • 2.1.4
    • None
    • None
    • None
    • DevX 14
    • 2

      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

        Acceptance criteria

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

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

                Created:
                Updated:
                Resolved: