Skip to content
Snippets Groups Projects
Commit 07c59541 authored by Matt Butcher's avatar Matt Butcher
Browse files

#557720: Added a check to make sure that weights array has data before trying to loop through it.

parent a89a5df0
No related branches found
No related tags found
No related merge requests found
......@@ -315,6 +315,9 @@ function quiz_questions_form_validate($form, $form_state) {
$placeholders = db_placeholders($question_types, 'varchar');
$sql = 'SELECT COUNT(nid) FROM {node} WHERE type IN (' . $placeholders . ') AND nid = %d';
$already_checked = array();
if (empty($form_state['values']['weights'])) {
return;
}
foreach ($form_state['values']['weights'] as $id => $weight) {
if (in_array($id, $removed)) {
// Ignore items that are going to be removed anyway.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment