Small error with guest questions
Small error with guest questions
If question was asked by guest, then if you try to add an answer to it, you'll get an error:
Warning: array_merge(): Argument #1 is not an array in /components/com_communityanswers/controllers/answers.php on line 522
Here's a code:
Clearly $asker here is an object, not array. This is why error occurs. Changing to this fixes the problem:
Warning: array_merge(): Argument #1 is not an array in /components/com_communityanswers/controllers/answers.php on line 522
Here's a code:
if($question->created_by == 0){
$asker = new stdClass();
$asker->name = $question->username;
$asker->email = $question->email;
$asker->subid = 0;
$admins = array_merge($asker, $admins);
}
Clearly $asker here is an object, not array. This is why error occurs. Changing to this fixes the problem:
$admins = array_merge(array($asker), $admins);
Access to viewing replies is restricted.
Showing 1 of 1 replies
You do not have permissions for replying to this topic.