[MAGNOLIA-4468] editCode control doesn't work (anymore?) when adding components (DialogEditCode) Created: 04/Jul/12  Updated: 19/May/22  Resolved: 19/May/22

Status: Closed
Project: Magnolia
Component/s: admininterface, gui
Affects Version/s: 4.4.5, 4.5.3
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Magnolia International Assignee: Unassigned
Resolution: Won't Do Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:

 Description   

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 ?)



 Comments   
Comment by Roman Kovařík [ 19/May/22 ]

Hello,

This ticket is now marked as closed due to one of the following reasons:

  • A long period of inactivity
  • Uses an old or Beta version of an application, module, or framework that we no longer support
  • The issue is no longer reproducible or has been fixed in later versions

If you are still facing a problem or consider this issue still relevant, please feel free to re-open the ticket and we will reach out to you.

Thank you,
The Magnolia Team

Generated at Mon Feb 12 03:56:04 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.