<![CDATA[ mxfb - Success Message RTE saving error - My Forums]]> https://forums.modx.com/thread/?thread=95636 <![CDATA[mxfb - Success Message RTE saving error]]> https://forums.modx.com/thread/95636/mxfb---success-message-rte-saving-error#dis-post-517610
If any html tags are inserted (<strong>, <em>, etc), the following error occurs on save:

Uncaught SyntaxError: Invalid regular expression: missing /

This is the bit that is malformed:
({"success":true,"message":"","total":0,"data":[],"object":{"form_id":1,"name":"sss","enablepages":false,"active":false,"owners":"","emailrecipients":"","opendate":0,"closedate":0,"maxnumbersubmissions":0,"successmessage":"dsf<b>sdfds<\/b>","successtargetdocid":0,"successredirectenable":false,"maxreachedmessage":"","context":"All","createdon":1419825711,"createdby":1,"editedon":1419826190,"editedby":1,"action":"mgr\/forms\/update"}}</b>)


in the successmessage parameter, it is not encoding/escaping the first <b> tag, but it is the closing tag, and that is wigging out the JSON string

Is there something that I can add to the update.class.php to clean this up?

]]>
dvstudiosinc Dec 28, 2014, 10:12 PM https://forums.modx.com/thread/95636/mxfb---success-message-rte-saving-error#dis-post-517610
<![CDATA[Re: mxfb - Success Message RTE saving error (Best Answer)]]> https://forums.modx.com/thread/95636/mxfb---success-message-rte-saving-error#dis-post-517637
I replaced it with the following (which unsets the RTE fields prior to returning the success response... which seems to be where the issue was):
public function cleanup() {
        $objectArray = $this->object->toArray('',true);
        unset($objectArray['successmessage'],$objectArray['maxreachedmessage']);
        return $this->success('',$objectArray);
    }


This fixed the error and now the Form Manager will complete its save process without complaint.

It sure would be nice to have this component on GitHub to put all these updates I have been implementing on my install somewhere that Charles could pull em....]]>
dvstudiosinc Dec 29, 2014, 10:40 AM https://forums.modx.com/thread/95636/mxfb---success-message-rte-saving-error#dis-post-517637