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.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | stop_form_overriding_quiz_question_form-2575971-0.patch | 850 bytes | jarrodirwin |
Comments
Comment #2
jarrodirwin commentedComment #4
da_cloud commentedIsn't this issue a duplicate off https://www.drupal.org/node/2212789
#2212789: [1.10] Quiz dd_lines question type render bug
Comment #5
da_cloud commented