views:

235

answers:

2

Hi,

So here's a very strange thing I've seen FCKEditor do: If there's a large amount of text pasted in it, it will simply drop it and empty itself upon POST for some very odd reason. I'm not sure what to debug to catch the error in my code or if it's just a limitation of the editor itself. Thoughts? I should say that it works just fine if the amount of content is limited; plain-text equivalent to a page or two of a word document for example.

A: 

I don't know why it happens, but to narrow down whether it's a problem with the FCKEditor or the recipient process, try alerting with the contents of the editor right before the POST request is sent.

Otherwise - is the size of POST data limited somewhere on your server?

Dominic Rodger
I have changed post_max_size and it has had no effect. Could you please explain what you mean by "alerting with the contents of the editor"? Thanks!
HelpAppreciated
I meant in JavaScript - as in `var foo = get_contents_of_fck_editor_somehow(); alert(foo);`
Dominic Rodger
I also had this problem a while back and it turned out to be the formatting of the code fckeditor creates. It was terminating the post data I was sending prematurely and so only partial data was getting to my DB. The way I tested for it was just as Dominic suggested, do a simple alert(fckeditor code); before the post data is sent and make sure it is getting it.
Levi
+2  A: 

I believe that the problem is in how you are storing the data in your DB and not in FCKEditor - I have posted over 300 pages of text without getting the error that you are describing.

I would try echoing everything that's being posted. Put this line of code at the top of the script you are posting to.

echo '$_POST = '. htmlentities(var_export($_POST, 1)); die;

If I'm right, your issue is with MySQL truncating the data that you are putting into it. This problem is hard to see with default MySQL error reporting.

james.c.funk