Needs review
Project:
Menu Position
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
5 May 2013 at 11:04 UTC
Updated:
17 Feb 2017 at 08:42 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
mike.davis commentedHi @hass,
I have recently had the need to also add a condition based upon a field name value., here is a patch that has worked for me.
This currently just provides a list of fields that are available in the site and a text field for the value to match against. This currently only works for node data, but it probably wouldn't be a big change to make it work with taxonomy as well.
Thanks
Mike
Comment #2
mike.davis commentedForgot to mark it for review.
Comment #3
mike.davis commentedarh ... wrong status .. sorry :)
Comment #4
rvilarIt works for me.
Comment #5
agileware commentedUpdated patch to #1 which fixes a problem where Entity Reference field values were not being compared.
Comment #6
axe312 commentedPatch is working very well with list fields. Haven't testet it yet with entity reference fields.
Comment #7
leksat commentedI did not look at the code, but can confirm that #5 patch works well with common fields.
Comment #8
kreatil commentedPatch #5 works for me. In my use case I'm checking against a multi-value entity reference field which references taxonomy terms. Therefore I had to add a new line after line 24:
in order to retrieve the name value of delta#0 for that field.
I'm sure there would be a more flexible solution for that, but in my special use case it works perfectly.
Comment #9
mstrelan commentedPatch #5 does not work for multi-value fields, eg select lists. Also updated
ifstatements to use Drupal coding standards and use ofdrupal_map_assoc()instead ofarray_combine().Comment #10
rv0 commentedThanks for this patch, works very well!!
Comment #11
cdmo commented#9 worked for me on a select list. I applied the patch to 7.x-1.2
Thanks!
Comment #12
BarisW commentedWhat is this 'identifier' => 'TRUE'? I've never seen it. What's its use?
This should be
'#empty_option' => t('- Please select -'),
on the select. Mind the t().
Other than that, the patch looks good. Please re-roll against dev.
Comment #13
focal55 commentedNew patch re-rolled against 7.x-2.x that addresses BarisW's second point.
Comment #14
BarisW commentedThanks all, but the patch in #13 is missing the newly added file from #9.
If someone can combine these changes into one patch, that would be nice.
Comment #15
skylord commented#9 with fix from #13
Comment #16
skylord commented#13 was buggy as i see now. :-) So, here's fixed patch which one also addresses #12