Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+1 vote
589 views
in Plugins by

In a filter module plugin, you can edit the content passed to it. But if your edits break other validation rules, the post still goes through. Here's an exaggerated example:

public function filter_question( &$question, &$errors, $oldquestion )
{
  $question['title'] = '';
}

Now the question title ends up blank and no error is given. It's very reasonable that a question could replace some words and end up at say 19 characters instead of your set minimum of 20.

Is there a way to call Q2A's regular post validation after making changes?

Q2A version: 1.5

1 Answer

0 votes
by

Yes, you can essentially load the default filter and run it manually. Please try adding this at the end of your own filter module (code not checked):

$module=qa_load_module('filter', '');
$module->filter_question($question, $errors, $oldquestion);

...