I have content type with image field. When I edit node and upload image this problem take place. After I click on "+" tree opens and then fast closes by itself. My currently solution is I choose term before upload image but this badly. This happens because after upload image launched Drupal.attachBehaviors and function
$('.term-reference-tree-button', context).click
binding second time. Maybe need change this part of code on:
$('.term-reference-tree-button:not(.term-reference-tree-button-processed)', context).addClass('term-reference-tree-button-processed').click

Comments

dench0’s picture

Issue summary: View changes

find problem

bartk’s picture

Status: Active » Postponed (maintainer needs more info)

What version of Term Reference Tree are you using?

bartk’s picture

I ask because I have an idea of what's causing the problem, but if I'm right it would be fixed in 1.9. The 2.x branch is for development only; it's not intended for production use and at the moment it doesn't do anything that 1.9 doesn't. If you're using 2.x (particularly an old version of it), please switch to 1.9 and let me know if the issue persists.

bluish’s picture

Version: 7.x-2.x-dev » 7.x-1.9
Status: Postponed (maintainer needs more info) » Active

Hi BartK. I use Term Reference Tree 7.x-1.9 (and Drupal 7.8) and I confirm the issue dencho reported. When the node form first loads, I can open the tree normally. But if I select and upload an image and then move on to open the tree by clicking a "+" to go to an item on the lower level, the parent will open quickly but then close down, in a flash. If I remove the photo uploaded and go back to the tree and try to open a parent, it will work again, but, only after flashing one time, that is, open, close, open again. I uploaded and removed an image several times to see what happens - there will be several flashes before the parent finally opens increases, it seems. Also as dencho reports, if you first select tree items and then upload an image, things work, but not the other way around. Thanks.

bartk’s picture

I'm suspicious what's happening is that for some reason the drupal behavior that attaches the event that opens and closes the tree is running multiple times. I need to add some sort of check to the object to make sure it only happens once.

dench0’s picture

I use the last stable versions of module and Drupal. In the first post I written reason of this issue and possible solution of this problem (I guess you not understood due to my poor english).

bartk’s picture

No, it's not your English. I just didn't read very carefully. I apologize. :)

I'll get the fix in shortly.

Rontero’s picture

Hierarchical Select also causes this problem. And as posted previously this strange behavior only occurs after using another widget (HS in my case).

dgtlmoon’s picture

Version: 7.x-1.9 » 7.x-1.x-dev

I can confirm this issue in the latest 1.x dev

anniegreens’s picture

Status: Active » Needs review
StatusFileSize
new689 bytes

This is occurring in combination with the video module upload as well. Patch applied with solution provided by @dencho.

dgtlmoon’s picture

works for me, can anyone else confirm?

mnshantz’s picture

Works for me as well.

Rontero’s picture

Confirmed

filsterjisah’s picture

Works, you could better use once() in Drupal 7 instead of .addClass() combined with :not() --> http://drupal.org/node/444344

derhasi’s picture

There's the patch using D7 standard .once() .

mikran’s picture

Status: Needs review » Reviewed & tested by the community

#1559598: Patch to fix the collapse event click after another module (node reference) ajax call (with patch) closed as a duplicate to this. Out of all the patches the patch in #14 looks best to me.

Pierco’s picture

Yes patch #14 works well for me too.

valderama’s picture

Can confirm that the patch works as expected.

As it is a simple change, I would hope that it gets commited soon.

Thanks!

crimsondryad’s picture

We need this too. Pretty please drop a release?

crutch’s picture

confirm works, thanks for fix

dave reid’s picture

Status: Reviewed & tested by the community » Fixed

Tested and committed #14 to 7.x-1.x. Thanks everyone!

http://drupalcode.org/project/term_reference_tree.git/commit/8c23c4f

Status: Fixed » Closed (fixed)

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

Anonymous’s picture

Issue summary: View changes

find error