When using the ctools dependent functionality on field (in my case a taxonomy field) where you have made multiple selections possible the original ctools dependent matching does not work.

The original code only iterate through arrays on the trigger items and not through the selection which in this case is an array as well.

A patch for this is provided.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Status: Needs review » Needs work

The last submitted patch, ctools-dependent.patch, failed testing.

sl27257’s picture

FileSize
910 bytes

sl27257 queued ctools-dependent.patch for re-testing.

The last submitted patch, ctools-dependent.patch, failed testing.

sl27257’s picture

New try with the same diff but in a slightly different format...

sl27257’s picture

sl27257’s picture

Status: Needs work » Needs review

Moved to "Needs review"

sl27257’s picture

Updated the patch. "Always reset your inner indexes"

DamienMcKenna’s picture

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

DamienMcKenna’s picture

Assigned: sl27257 » Unassigned

You should only assign an issue to yourself if you're going to work on it, otherwise please leave it unassigned. Thanks :)

sl27257’s picture

I am sorry but I am not sure I understand? This was and still is a problem with the current ctools :( (At the time I wrote it it was in 7.x-1.4) The fix is working for me but as I wrote the patch it it is always good to have some else to review it as stated here ("CNR"):

https://www.drupal.org/node/156119

If someone finds a problem I will check and update my fix. So I don't understand why it can't be assigned to me?

Please explain thanks, I might have missed something?

BR

/Thomas

DamienMcKenna’s picture

@sl27257: I look at the "assigned" status to mean "I am actively working on this right now", not "I worked on this at some point in the past and can pick it up again if it needs attention". My rationale is that most issues bounce around with multiple people contributing to the final solution, including multiple people working on improving the patch, and having it assigned specifically to one person can turn others away from collaborating.

IMHO the best thing to do is assign the issue to you when you're actively working on it. If you stop being able to actively work on it then change the assignment to "unassigned" so someone else can pick it up, likewise when you've completed something (i.e. upload a patch) also change it to "unassigned" for others to review it.

Otherwise, thank you for the patch, I'll see if I (or someone at Mediacurrent) can give it a review this coming week. Happy New Year to you!

sl27257’s picture

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

This still exists in the latest 7.x-1.6 release.

DamienMcKenna’s picture

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

@sl27257: The standard practice is to just leave the version as the -dev version, that way we know it's still appropriate.

Did you test the patch?

Chris Matthews’s picture

The 4 year old patch in #8 to dependent.js applied cleanly to the latest ctools 7.x-1.x-dev, but still needs to be reviewed and tested.

Checking patch js/dependent.js...
Applied patch js/dependent.js cleanly.