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

FormView.getPropertyValue fails on NPE when user's locale is not available in site

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Critical Critical
    • 6.2
    • None
    • None
    • None
    • UI Framework 16, UI Framework 17
    • 5

      If user language is not available in Site configuration then FormView.getPropertyValue fails on NPE.

      Caused by: java.lang.NullPointerException
      	at info.magnolia.ui.framework.databinding.view.FormPresenter.getBoundPropertyValue(FormPresenter.java:94) ~[magnolia-ui-framework-6.2-SNAPSHOT.jar:?]
      	at info.magnolia.ui.framework.databinding.view.FormView.getPropertyValue(FormView.java:179) ~[magnolia-ui-framework-6.2-SNAPSHOT.jar:?]
      	at info.magnolia.ui.framework.databinding.ItemEditor.getPropertyValue(ItemEditor.java:49) ~[magnolia-ui-framework-6.2-SNAPSHOT.jar:?]
      	at info.magnolia.ui.contentapp.action.ShowVersionAction.getVersion(ShowVersionAction.java:84) ~[magnolia-ui-framework-6.2-SNAPSHOT.jar:?]
      	at info.magnolia.ui.contentapp.action.ShowVersionAction.execute(ShowVersionAction.java:72) ~[magnolia-ui-framework-6.2-SNAPSHOT.jar:?]
      

      Problem is in ItemEditor#getPropertyValue method which resolves MgnlContext.getLocale() which doesn't have to be available for site (Authoring locale vs Content locale). This would be problem also on another places where MgnlContext.getLocale() is used.

      Reproduce:
      1. Log as Superuser and "Edit User Profile"
      2. In "Preference" tab Switch language to something else than English/German, for example to Czech
      3. Relogin
      4. Open new Pages app
      5. Publish "/travel/contact" page. So the version is created
      6. Click "Show versions" action and select version and click Show
      7. NPE is thrown

        Acceptance criteria

              apchelintcev Aleksandr Pchelintcev
              mdivilek Milan Divilek
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Bug DoR
                  Task DoD