Community & Support

Sometimes pasted body page dissappears, gone after preview or submit ? what to check. (especially msword stuff)

When pasting from websites or word docs... or the html generated by other webpages from such...
Sometimes when I preview the page and/or submit the page what was showing in the body dissappears leaving
nothing. But if I past a little then edit and append piecemeal sometimes I can sometimes not... I've tried different
TinyMCE settings and using their MSword filter or not... THEN I took the raw HTML code w/o head body tags
and then on drupal disable editor, and past the code, same result, even with TinyMCE module uninstalled.

I knew to change input type...
BTW, I did try other input types, and had made RTF input type w/o filters...

Okay, for simple pages, no problem... was migrating old website to drupal by cut and paste from web browser
for content. Okay for many most pages... The web pages that seem really have issues are some longer pages originally created from ms word documents with lots of tables and style changes.... old website was MSfrontpage with lot of pasting from msword....

IT is strange I don't see any error messages, the content for body just does not appear after preview nor submit.

I did update to 5.11, and that did not change anything nor break anything else...
Perhaps their is something in drupal that I need to tweak that verifies the body input before preview/submit?

I did try searching the forums/google... but did not find the answer :(
While I did not consider myself a newb, at this point I am asking what should I check, were should I look for log messages...

TIA...

(hope its not a 3rd party module...)

I wonder if I am hitting an operating system/apache/php issue? I do use Openbsd 4.3, which has a security tight version of php/mysql that can cause strange issues for other onlamp apps... Don't think it is a web browser post issue, tried w/ msie/firefox/chrome,
and can repeat it..

suggestions?

Comments

I found that I had to alter

I found that I had to alter the pasted text in some way (add then remove a character for example)

hmmm

THought I'd edited some of the paste, like change or deleted a sentence or three... YEP,

I have pasted then modified some before submitting, doesn't help unless the section I modified (like cutting half of the paste off)
was what drupal did not like :(

I am still curious why I do not get an error message... especially if drupal decided it did not like the content and erased it... Is drupal suppose to let you know it did not accept the content?

mysql? or php?

I think it could be the mysql server. using phpMyadmin to change body for a post in nod_revisions table also fails to change... so both drupal and phpMyadmin are not changing the longtext for the page.

Checked and using 5.0.51a mysql server, will see if update and see if quotes, or apostrophes or some character is an issue..
... not fun...

OKAY, I think it may be php thing... when the problem occurs... I don't see an UPDATE statement in the mysql log.

SOLVED, was hardened php setting.

found the error message, even though I had set the regular error to temp display to output it did not,
but put in an error log just a brief line...

[Wed Oct 22 11:30:54 2008] [error] ALERT - configured request variable value length limit exceeded -
dropped variable 'body' (attacker 'xxx.xxx.xxx.xxx', file '/var/www/drupal/index.php')

Looking at phpinfo()

"This server is protected with the Suhosin Extension 0.9.20"

And hardened (suhosin) php appears may not necessarily log the same way as other php errors...

In php.ini I set hardened, suhosin to simulation and the post succeeded,
suhosin.simulation = On
So I set it back to off to see what setting would help...
looking at the default php.ini I saw these possiblilites:

; If you fear that Suhosin breaks your application, you can activate Suhosin's
; simulation mode with this flag. When Suhosin runs in simulation mode,
; violations are logged as usual, but nothing is blocked or removed from the
; request. (Transparent Encryptions are NOT deactivated in simulation mode.)
;suhosin.simulation = Off

; Defines the maximum length of a variable that is registered through the
; COOKIE.
;suhosin.cookie.max_value_length = 10000

; Defines the maximum length of a variable that is registered through the URL.
;suhosin.get.max_value_length = 512

; Defines the maximum length of a variable that is registered through a POST
; request.
;suhosin.post.max_value_length = 65000

; Defines the maximum length of a variable that is registered through the
; COOKIE, the URL or through a POST request. This setting is also an upper
; limit for the variable origin specific configuration directives.
;suhosin.request.max_value_length = 65000

I tried increasing the suhosin (hardened) post.max_value_length and
request.max_value_length values in the php.ini then used apachectl
to restart or graceful to pick up change:

suhosin.post.max_value_length = 999999
suhosin.request.max_value_length = 999999

--- AND THAT WORKED ----

The default was 65000, and 999999 is probably to large,
any suggestions?

and also, it was kind of pissy that the hardened php issue did not get trapped and Drupal and phpmyadmin thought the post was successful.