When submitting something with an input format enabled, and the user previews the node, the filtered text gets to the textarea too.
So let's suppose I use BBCode with HTML Filter for escaping html tags (which I do). I also set previewing to be required. The user writes the story with full of bbcodes which are converted to html nicely, so the preview is nice, he/she wants to submit it, but now the converted text (the html output of bbcode filter) is in the textarea, so after submit it gets escaped, and in the node there will be only html tags, the source of what he/she wanted to see.
I suppose that this is not intended to be this way. I tried this out on a website with 4.4, and I could always see the bbcode source after preview, and even when editing submitted nodes.
Comments
Comment #1
LacKac commentedNow I tested it once more without requiring preview. After composing the node and previewing the filtered text still gets to textarea, but hitting back on browser and choosing submit gives the right effect. When editing again the node I see the bbcode source.
So the bug must be in the form generation after the preview.
Comment #2
jonbob commentedAre you by any chance using PHP 5? The object-passing semantics changed from PHP 4 to PHP 5, and there are some related issues to be resolved still.
Comment #3
LacKac commentedYeah, that's right, meanwhile I found out that almost all functions which take part in the process use objects. So that's passing by reference which causing me pain.
Anyway why is Drupal using objects at so many places? Is it better than using arrays for the same task? As I saw it is not using any OO aspect when using objects.
Comment #4
jonbob commentedI think this becomes a dup of http://drupal.org/node/view/9292 since it is a PHP 5 issue.
As far as I know, the decision to use objects rather than arrays throughout Drupal was largely syntactic (easier to type). Drupal does employ many OO philosophies, but none of them are related to the OO-related syntactic sugar that PHP provides.