To reproduce, edit a multichoice question. Make sure "Create new revision" is checked. After saving, any answers/choices that already existed before you edited it will disappear.

I fixed it by editing the multichoice_update() function in multichoice.module. When it loops through the answers, and it comes across one that has an answer_id set (meaning, apparently, that the answer already existed when the node was loaded), it'll only ever do a DELETE or an UPDATE, and never an INSERT. But an INSERT is exactly what you need when the vid of the question node changes.

I attached a patch that fixes it for me. It changes the foreach loop so that when it checks for an answer_id, it also makes sure $node->revision is empty. In addition, I modified the elseif so it won't insert anything where $value['delete'] isn't empty, since some of those can reach it now.

CommentFileSizeAuthor
multichoice.patch957 bytesdarktygur-1

Comments

eabrand’s picture

It worked for me! Good Job!

mbutcher’s picture

Status: Needs review » Fixed

This patch was committed, and will be in Quiz 3.1. Thanks for the work!

Matt

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.