After updating to 7.x-4.0-rc1 some of our custom question types stopped including the JS/CSS in the node form even though we are attaching them via the $form[#attached] method.

I've tracked down the problem to this commit http://cgit.drupalcode.org/quiz/commit/?h=7.x-4.x&id=6791d15ff9b38418a30... whereby quiz_question_form() was changed to quiz_question_form_node_form_alter(), more specifically the array_merge() in the new function. By using array_merge, any multidimensional arrays (and in this case the $form[#attached] one) is being replaced by the original in $form instead of appending the ones from the $quiz_question_form.

Attached is a patch to use array_merge_recursive() instead and i've flipped the order of the arrays in the function so the values from $quiz_question_form are always added after those in $form.

Comments

jarrodirwin created an issue. See original summary.

jarrodirwin’s picture

Status: Needs review » Needs work

The last submitted patch, 2: stop_form_overriding_quiz_question_form-2575971-0.patch, failed testing.

da_cloud’s picture

da_cloud’s picture

Status: Needs work » Closed (duplicate)