First submission works fine.
After the first submission, other participants answers are processing via ajax submit while this mode is restricted to edit/delete actions.
This ajax submission mode for new answers is producing an error 500 in makemeeting_answer_js callback.
This is due to the fact that ajax callback has been added to the form while it should not.
In makemeeting_answers_form function, please fix the following loop by replacing $answer by $_answer and to avoid to name this loop variable like the function parameter that is tested after this loop.
// And add each answer to our results array for futher use
foreach ($results as $result) {
$_answer = unserialize($result->value);
if (is_array($_answer)) {
foreach ($_answer as $key => $value) {
if ($value) {
$answers[$key] = empty($answers[$key]) ? 1 : $answers[$key] + 1;
}
}
}
elseif (is_string($_answer) && $_answer) {
$answers[$_answer] = empty($answers[$_answer]) ? 1 : $answers[$_answer] + 1;
}
}
Hope this will help.
Comments
Comment #1
SebCorbin commentedAlthough I could not reproduce the bug, this code is cleaner, so committed :)