Uploaded image for project: 'Magnolia'
  1. Magnolia
  2. MAGNOLIA-4468

editCode control doesn't work (anymore?) when adding components (DialogEditCode)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Major Major
    • None
    • 4.4.5, 4.5.3
    • admininterface, gui
    • None

      When adding a component whose dialog has an editCode control with useCodeHighlighter set to true (or not set, since true is the default in this case), a NullPointerException is thrown. Editing an existing component works fine.

      To reproduce: on demo, change STK's stkHTML dialog so that its editHTML control is of type editCode (it's shipped as "edit", which is not impacted by this bug). Try to add a component of type "HTML" to a page. Boom.

      I was able to reproduce this on 4.4.5 (on our docu site) and 4.5.3 (on the demo site)

      Exception as thrown in 4.4.5:

      java.lang.NullPointerException
      	info.magnolia.cms.gui.dialog.DialogEditCode.drawEditorWithSyntaxHighligher(DialogEditCode.java:153)
      	info.magnolia.cms.gui.dialog.DialogEditCode.drawHtml(DialogEditCode.java:133)
      	info.magnolia.cms.gui.dialog.DialogControlImpl.drawSubs(DialogControlImpl.java:321)
      

      Workarounds:

      • don't use editCode
      • set useCodeHighlighter to false (which essentially boils down to the same)

      Diagnostic:
      As far as I can tell, the bug is happening in DialogEditCode#drawEditorWithSyntaxHighligher, where we call getStorageNode(), which doesn't exist yet when creating a new component. (perhaps a side-effect of some of the content api changes in 4.3 ?)

        Acceptance criteria

              Unassigned Unassigned
              gjoseph Magnolia International
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Bug DoR
                  Task DoD