Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.

Content gets lost when submitted

+1 vote
asked Jan 17, 2016 in Q2A Core by q2apro
retagged Jan 18, 2016 by Scott

Just wanted to let you know that some of my users are reporting that their content gets lost.

I have checked their posts and indeed it is EMPTY. Empty string!

It confuses me because I thought this would not be possible - posting with 0 letters should be prevented. Any clue?

1. The question title is transferred, the tags too.
2. I am using SCeditor.
3. no error_log


Update: I converted a question with empty content to a comment, then I got:
PHP Notice:  Undefined index:  content in qa-include/qa-theme-base.php on line 2328 - should an empty content not be caught?

Q2A version: 1.7.1
commented Jan 18, 2016 by q2apro
It happened only with the question until now. I guess my regular users do not copy from PDF files and get invisible control characters (I am thinking they cause the problem). Weird, btw, that I copied the same PDF the user mentioned and it worked right away. That is why I have asked the user to tell me about his PDF reader - no answer yet. It could also be the new browser "Microsoft Edge" but also not sure how the empty content could pass and the cut content could happen.

For the fixes, do you mean: https://github.com/q2a/question2answer/commit/7f65de542725071522e036508e3519353509b020 ? The !empty() was IMO better because the isset() will let through even if the $content is an empty string, as far as I know. Can you point to the fixes - or should I just download the entire package from github and put it on my server?
commented Jan 18, 2016 by Scott
No, that line is fixing the notices that appear if blank content happened to get through. empty() does not ensure there is content as the string of '0' is classed as empty. I think the changes may be on the 1.8 branch.

But I don't think those changes would fix the issue entirely, because something else is truncating the content. Do you have a link to the SCeditor so I can try? Thanks.

Please log in or register to answer this question.