I've created a patch that allows you to use cross-entity dependees using the Inline Entity form or Field collection module. It's probably far from perfect, but it does (at least for me) the job!
The dependee collection process is quite heavy, so it might take a while to load your field conditions page for the first time (all lists are cached).
Please note this patch depends on the patch in #1464950-67: Support for multiple "Field collection" and "Multifield" fields, I've also included some t() changes from the patch in #1464950-42: Support for multiple "Field collection" and "Multifield" fields (all credit goes to joel_osc).
Comments
Comment #1
MatthijsDon't forget to apply #1464950-67: Support for multiple "Field collection" and "Multifield" fields first!
Comment #2
MatthijsHere's an updated version of the patch, the previous version caused some issues in the admin interface...
I also changed (and fixed) the way conditions are grouped together, you now get a clean table with an AND grouping the other groups if there is more than one group.
Comment #3
MatthijsAnother update due to a minor issue with the field trail...
Comment #4
MatthijsHere's another update that fixes the support of optional Field Collection items.
Comment #5
MatthijsUpdated patch attached, I've fixed 2 minor issues:
Comment #6
ziroow CreditAttribution: ziroow commentedHi, I'm trying to apply the patch, but I get 10 hunks failed. There are errors in the screenshot. What am I doing wrong?
Thank you in advance for your reply.
Comment #7
MatthijsDid you apply #1464950-67: Support for multiple "Field collection" and "Multifield" fields before applying this one?
I'm on Windows, so I cannot test "patch -p1" but "git apply" with the latest patch works fine on a clean module checkout.
Comment #8
ziroow CreditAttribution: ziroow commentedYes I apply patch #1464950-67 before applying this one.
I'm not familiar with git, but I urgently need to use the functionality of the module on the new site(( Can I download the patched module or as I apply the patch via git?
Comment #9
MatthijsI've uploaded the patched module here: http://www.sendspace.com/file/vq5rg7
Comment #10
ziroow CreditAttribution: ziroow commentedThank you very much!
Cross entity dependes earned))
But if dependent choose a field of type "fild_collection", it is not hidden when creating/editing a node.
Comment #11
ziroow CreditAttribution: ziroow commentedI managed to solve my problem thanks to this patch conditional_fields-fix_for_collections_11.patch
Thanks for the help!
Comment #12
MatthijsNo problem! But please don't mark this issue as fixed, because the patch still need reviewing...
Comment #13
MatthijsFixed faulty advanced static pattern.
Comment #14
MatthijsPatch updated, I fixed the undefined index issues in conditional_fields_evaluate_dependencies().
Comment #15
MatthijsAnother "undefined index" update.
Comment #16
MatthijsAnother update...
Comment #17
kyletaylored CreditAttribution: kyletaylored commentedAfter applying #1464950: Support for multiple "Field collection" and "Multifield" fields, I get.
Comment #18
MatthijsDid you apply the correct patch (the one in comment #62)? Please try "git apply" instead of "patch -p1", that works for me...
Comment #19
kyletaylored CreditAttribution: kyletaylored commentedgit apply
doesn't work for me,patch -p1
always works (This is the general workaround). I didn't use the patch in comment #62, and when I did use it instead of #81, I received even more errors.The most recent RTBC patch to be tested is #81. Shouldn't this reflect what's in there first since it came in about 2 months prior to your patch?
Comment #20
sifuhall CreditAttribution: sifuhall commentedI have the same problem.
Comment #21
MatthijsHi,
I used the patch in #62 because it was already applied in the project I was working on. I'll check the failed hunks and create a new patch soon.
Matthijs
Comment #22
jonhattanI updated the patch in #1464950: Support for multiple "Field collection" and "Multifield" fields with minor fixes (comment #101) and also rerolled #16 here.
In this patch I've excluded the t() changes, since they're unrelated. Also, whitespaces introduced within #1464950 are fixed there.
Comment #23
SocialNicheGuru CreditAttribution: SocialNicheGuru commented#22 doesn't apply to the dev version of conditional fields
git apply conditional_fields-cross-entity-dependees-1995516-22.patch
error: patch failed: conditional_fields.module:454
error: conditional_fields.module: patch does not apply
patch -p1 < conditional_fields-cross-entity-dependees-1995516-22.patch
patching file conditional_fields.css
patching file conditional_fields.module
Hunk #3 FAILED at 461.
Hunk #4 succeeded at 733 (offset 9 lines).
Hunk #5 succeeded at 902 (offset 9 lines).
Hunk #6 succeeded at 949 (offset 9 lines).
Hunk #7 succeeded at 970 (offset 9 lines).
Hunk #8 FAILED at 1067.
Hunk #9 succeeded at 1320 (offset 8 lines).
Hunk #10 succeeded at 1428 (offset 8 lines).
Hunk #11 succeeded at 1518 (offset 8 lines).
Hunk #12 succeeded at 1544 (offset 8 lines).
Hunk #13 succeeded at 2129 with fuzz 2 (offset -9 lines).
2 out of 13 hunks FAILED -- saving rejects to file conditional_fields.module.rej
patching file includes/conditional_fields.admin.inc
Comment #24
jonhattan@SocialNicheGuru, did you apply #1464950-101: Support for multiple "Field collection" and "Multifield" fields first?
Comment #25
SocialNicheGuru CreditAttribution: SocialNicheGuru commentedit does apply cleanly if done in that order.
I also had a conflict with another patch too.
Sorry to clutter the queue!
Comment #26
artis.bajars CreditAttribution: artis.bajars commented#22 works well as long as the field collection is limited to a single value. However, for multivalued field collections, as soon as you click "Add another item" the configured dependencies fail and the states are not applied for any of the instances.
Comment #27
SocialNicheGuru CreditAttribution: SocialNicheGuru commentedEdit: can this patch be rerolled against: https://drupal.org/comment/8419673#comment-8419673?