2

I am referring to this answer, but the question is valid for any similar answer. The content of the answer is the following one:

form_set_error() should be called inside your hook_validate() function as answered by LSU_JBob.

The answer is first wrong, as a from validation handler is not an implementation of hook_validate(), which is the hook present in modules implementing a content type to validate the form to build, or edit a node of that content type; a form validation handler is associated to any form, not just node forms. The answer given by LSU_JBob was caused from the fact the OP wrote drupal_set_error() instead of form_set_error(); while that answer would have a reason to be written (at least until the OP didn't correct the question), this other answer doesn't have any reason to exist, as it doesn't answer what the question is really asking.

Apart from this, the main problem I see with this answer is that just agrees with a previous answer, without adding anything more. If the answer would have given a different snippet, a link to a documentation page, then the answer could have been better.

To this type of questions I would also include those short answers starting with "I think" and not longer than a line, for which no detail is provided.

What are the criteria to distinguish a comment posted as answer, from a true answer?

1 Answer 1

6

This was recently also discussed on Meta Stack Overflow and one of the answers there includes this handy chart.

Suppose the question is the following one, the chart describes if the answer should be an answer, a new question, a comment, or deleted.

How can I foo the bar in X?
I'm trying to foo the bar using qux. However, I get an error message <error>. What am I doing incorrectly?

 

answer-vs-comment

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .