SMF Development > Fixed or Bogus Bugs
[3704] WYSIWYG parsing
Orstio:
Post.php, Line 1198:
--- Code: --- if (!empty($_REQUEST['message_mode']) && isset($_REQUEST['message']))
--- End code ---
OK, so some history for the devs first. If you check the Dev board, you'll see a discussion between Grudge and I about the possible use of a third party WYSIWYG editor. It's probably best to read that first.
Now, if you take a look at this line, it requires that $_REQUEST['message_mode'] is set to some value. To use a third party WYSIWYG editor, the built-in editor needs to be off in the admin panel, otherwise there are conflicts and resulting javascript errors. If the built-in editor is off, $_REQUEST['message_mode'] is null.
The short version is that I'm ending up modifying this line to get a third party WYSIWYG editor working, and I don't think it was intended that way.
karlbenson:
I finally got around to tracking it
http://dev.simplemachines.org/mantis/view.php?id=3704
I did look for the topics you mentioned a whileback, I couldn't find anything too relevant.
I think though whoever fixes this (likely me) can probably see its a bug without extra reading.
Basically in using a third party wysiwyg, most don't come with support for bbcode, so you would likely need to hijack smf's html to bbcode functions. Since null will be false to !empty() that section won't run.
Orstio:
Right. Even if the editor does have support for BBC, once the form is submitted, it's all SMF. The third party editor has no influence after form submission.
I think it can be circumvented by having it look for a specific value when displaying the editor? Perhaps something like a value of "default" or "native" would work instead.
Then a third party editor mod installation could use a value of "3rdParty", for example, and the default editor would not attempt to display, but the html to bbc would still work.
karlbenson:
Orstio, what would you think of just doing as a fix.
if ((!empty($_POST['message_mode']) || !isset($_POST['message_mode'])) && isset($_POST['message']))
(from PersonalMessage.php, theres another in Post.php as you posted above)
Orstio:
It won't matter. I need to change it to this:
--- Quote ---if (isset($_POST['message']))
--- End quote ---
In order for the parsing to work without the default WYSIWYG display.
I think my first post is misleading. The bug is not on this line. The bug is in the display of the editor being linked to the parsing, and moreso, the way that it is linked, not just the fact that it is. Editing this line is the easiest way to fix the code to work with the 3rd party editor (or break the code, depending on how you look at it. ;) ) but just because it's the easiest way to modify the code to work doesn't mean this quick and dirty method is the correct way to fix it.
And yes, I did need to do this to PersonalMessage.php as well.
Navigation
[0] Message Index
[#] Next page
Go to full version