Assigning variables by reference in the constructors makes the node object to behave strange - In Drupal 7 you load multiple nodes using the hook_node_load, which then uses a foreach ($nodes AS $node) - when then assigning the $node variable by reference it will continuously change and finalize with the last node in the $nodes array.

Removed the $this->node = &$node for each question type removes this strange behavior - haven't found any places that are actually effected by this change, might be that its some old logic from the D6 version?

Comments

lslinnet’s picture

And here is the patch file.

danny1997’s picture

Your patch resolved my problems. Thanks for your sharing.

P.S. But there are problems with the feedbacks.

lslinnet’s picture

Hey Danny, could you be more specific?

danny1997’s picture

StatusFileSize
new47.73 KB
new45.94 KB

Hi Lars, I attach 2 questions (Q1 and Q2, both wre multiple answers) to an article with nodereference and display them with the article using EVA.

Before the patch, only the titles of the questions are correct. The options of question 2 take place of options of question 1. The feedback of question 2 displays in both questions.
before the patch
After the patch, the titles and the bodies of both questions are correct. But the feedback of question 2 still shows in both questions.
after the patch

Thanks for your help. I am not sure if by design the closedquestion can only be displayed one for each page.

lslinnet’s picture

Ahh that is due to poor way of naming of the wrapper where the feedback goes we actually have the same issue in our current project but it is not really related to this issue - so could you create a new issue for this?

jvdkolk’s picture

Issue summary: View changes

I am cleaning this module's issue list. Could one of you let me know whether I can still safely apply the patch?

  • koosvdkolk committed e98c04e on 7.x-2.x
    Issue #1446668 by lslinnet: Removed assigning by reference
    
jvdkolk’s picture

Status: Active » Closed (fixed)

Fixed in 7.x-2.4. Thanks lslinnet!