QuickEdit Button ends in error message: text field is empty [2.0.17]

Started by Octavianus, March 18, 2020, 08:41:26 AM

Previous topic - Next topic

Octavianus

Hi,

I am running my forum on SMF 2.0.17 and since an update (maybe 17 or 16, I've installed both of them at the same day) the QuickEdit button seems to stopped working correctly.

See attached screenshots for further info (I am talking about the symbol in the down right corner). Please ignore the German layout.

Any hints from your side?

Shambles

Has anything been recorded in your error log?  Is there any conflict showing when using your browser's console inspector?

Octavianus

Thanks for the quick reply.

My forum's error log shows nothing related to that and is almost empty.

My console inspector says
"jquery not found"
When I click on that extended report it says
"Error: Incorrect contents fetched, please reload."

Please bear with me, my php knowledge hasn't grown since my last posts here.
By the way I am using Firefox 74.0 as browser.

izotz

I'm getting the same error in SMF 2.0.17. I think it is an issue with the quick edit button and special characters. Way to reproduce it :
1.- Post a message that will include the UK Pound symbol (£)
2.- Click the "Modify message" icon at the bottom right (quick edit button)
3.= Edit and press Save
We get the error mentioned above "The message body was left empty."
Using the "Modify" link above the message works fine.


Update : I was able to reproduce it in this very same message. So if any mod wants to give it a try for themselves, they just need to edit this message following the steps above.

butch2k

UTF-8 related issue. At least that's what happened my side.
A0 Non breaking space in subject (in "Re :")was causing issue and i was getting no subject errors, same goes for any message with accentuated characters for instance.

The $smcFunc['htmltrim']($smcFunc['htmlspecialchars']($_POST['subject'])) !== '' evalutate to true in Post.php JavaScriptModify function causing the process to throw a no subject error.

I made a quick fix adding
   $_POST['subject'] = utf8_encode($_POST['subject']);
   $_POST['message'] = utf8_encode($_POST['message']);
just after the globals in Post.php JavaScriptModify() funtion until i find out the root cause.

butch2k

Ok i found out where the issue is.
When upgrading from 2.0.15 to 2.0.16 two changes both related to UTF-8 where made to script.js functions:
String.prototype.php_to8bit()
String.prototype.php_urlencode()

Those are the culprits causing the Quickmodify function to get incorrectly encoded strings.

I tested rolling back to the 2.0.15 of those functions and that fixed the issue without having to resort to UTF-8 encode PHP side.

shawnb61

Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

shawnb61

Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

Advertisement: