Skip to content

Conversation

@syntaxseed
Copy link
Contributor

Plugins which manipulate the page editor form textarea can cause the field.form object to be null.

This causes the heading buttons to stop working. And the JS console shows an error:

Uncaught TypeError: Cannot read property 'prefix' of null at currentHeadlineLevel.

For example, plugin https://www.dokuwiki.org/plugin:dokucrypt2 requires this patch for its access of the form field. This small patch, prevents this issue by simply adding an additional check for null on the object.

Backward compatible. Does not change existing functionality in any way.

Copy link
Collaborator

@phy25 phy25 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! LGTM.

@splitbrain splitbrain merged commit b31dd27 into dokuwiki:master Oct 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants