XF 2.2 <xf:editor> not submitting correctly

NootSponge

Member
I've tried reverse engineering all I can but I just can't find where this issue is being caused 😔

When submitting data from a <xf:editor>, only portions (if anything at all) is returned from the editor. For example; I type test in the editor, submit the form, then check what the request vars are, it shows up as something that is not test. However, and this is the part that I have absolutely no clue how to even begin explaining, this only happens some of the time.

This is an example of what's happening:
G7WBMYR.png


Every time I submitted that form (except for the 'wtf' and 'testtest' ones) the only content in the editor was 'test'.

I tried dumping the request var when submitting the form and it was exactly the same as what the end result was, some mangled mess of the string submitted. Again, I've not been able to identify a common theme or trigger to why it does this and only on certain specific words. I thought maybe it didn't like SQL terms like 'ON' and 'WHERE' so it was just removing them but that's not the case either.

Since it's before the actual processing of data, I decided to try and see if it was a problem with the JS somewhere or maybe something in the templater but I was unable, although JS is not my strong-suit so I very well could've missed something.

I think it might have something to do with the saving of drafts or something with the Froala editor? There were a few instances where I would fix a typing mistake in the editor then submit the fixed string very shortly after fixing it and it would appear as the unfixed string, so maybe it's not saving the draft and therefore submitting the most recent draft when you submit the form? It also seems to depend on how frequently I actually submit the form? Super weird...

The editor js does mention that on line 302 where it says this.$form.on('ajax-submit:before draft:beforesync', function(){...} implying that it must sync before the form is submitted, so maybe that's not happening? But I would have no idea where to start in fixing that.

Any ideas?
 
Top Bottom