Simple Machines Community Forum

SMF Development => Bug Reports => Fixed or Bogus Bugs => Topic started by: Octavianus on March 18, 2020, 08:41:26 AM

Title: QuickEdit Button ends in error message: text field is empty [2.0.17]
Post by: Octavianus on March 18, 2020, 08:41:26 AM
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?
Title: Re: QuickEdit Button ends in error message: text field is empty [2.0.17]
Post by: Shambles on March 18, 2020, 08:51:02 AM
Has anything been recorded in your error log?  Is there any conflict showing when using your browser's console inspector?
Title: Re: QuickEdit Button ends in error message: text field is empty [2.0.17]
Post by: Octavianus on March 18, 2020, 09:04:49 AM
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.
Title: Re: QuickEdit Button ends in error message: text field is empty [2.0.17]
Post by: izotz on May 11, 2020, 03:31:46 AM
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.
Title: Re: QuickEdit Button ends in error message: text field is empty [2.0.17]
Post by: butch2k on August 14, 2020, 01:16:23 PM
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.
Title: Re: QuickEdit Button ends in error message: text field is empty [2.0.17]
Post by: butch2k on August 14, 2020, 01:35:43 PM
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.
Title: Re: QuickEdit Button ends in error message: text field is empty [2.0.17]
Post by: shawnb61 on August 14, 2020, 01:54:17 PM
This appears to be duplicate of:
https://www.simplemachines.org/community/index.php?topic=571082.msg4042818#msg4042818

The suggested fix is in that thread.
Title: Re: QuickEdit Button ends in error message: text field is empty [2.0.17]
Post by: shawnb61 on February 01, 2021, 05:41:22 PM
Closing - this was addressed in 2.0.18.