Skip to content

Messaging for OnBeforeSave events should allow HTML #6294

@modxbot

Description

@modxbot

everettg_99 created Redmine issue ID 6294

While coming up with a custom validation plugin, I discovered that the messages issued via $modx->event->output() during the various OnBefore Save events do not allow HTML.

To reproduce this:

  1. Create a plugin, add the following code:
    $modx->event->output('
    I will cause the system to hang...
    '); return 'Testing..';
# Tie this plugin to the _OnBeforeDocFormSave_ event # Save the plugin # Try to edit a resource: click Save.

h2. Expected result

I would expect my message would appear in the modal pop-up window, including any html:

I will cause the system to hang...

h2. Actual Result

The saving operation hangs entirely.

h2. Possible Solutions

At a minimum, strip_tags() should used to filter input so the system does not hang and an error should be logged stating that "No HTML is allowed".

Even better would be the ability to add HTML to the user messages. It would be extremely helpful to include links (e.g. to docs), or just basic formatting HTML for a better user experience.

Metadata

Metadata

Assignees

No one assigned

    Labels

    proposalProposal about improvement aka RFC. Need to be discussed before start implementation.type-frontendIssues related to UI/UX issues, mostly about styles and frontend implementations on JavaScript.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions