These notices are thrown when I choose "Content page: Tags Field" for one Selection Rule in my Variants.
Notice: Undefined index: module in ctools_entity_field_value_ctools_access_summary() (line 213 of /home/content/68/9050068/html/drupal/sites/all/modules/ctools/plugins/access/entity_field_value.inc).
Notice: Undefined variable: elements in ctools_entity_field_value_ctools_access_summary() (line 220 of /home/content/68/9050068/html/drupal/sites/all/modules/ctools/plugins/access/entity_field_value.inc).
It is my understanding that I should be able to use this choice to select pages based on taxonomy term tags. Please help.
Update:
I just got a second set of errors when I tried to do something similar on another Variant
# Notice: Undefined index: value in _ctools_entity_field_value_ctools_access_get_conf_field_values() (line 172 of /home/content/68/9050068/html/drupal/sites/all/modules/ctools/plugins/access/entity_field_value.inc).
# Notice: Undefined index: value in ctools_entity_field_value_ctools_access_check() (line 155 of /home/content/68/9050068/html/drupal/sites/all/modules/ctools/plugins/access/entity_field_value.inc).
Comment | File | Size | Author |
---|---|---|---|
#12 | Step 1 - add selection rule by tid | 29.2 KB | Anonymous (not verified) |
#12 | Step 2 - the notice | 57.26 KB | Anonymous (not verified) |
#8 | 1520036-entity-field-8.patch | 1.84 KB | andypost |
#4 | ctools-taxonomy-selection-criteria-error-1520036-3.patch | 1.49 KB | Kars-T |
#2 | ctools-taxonomy-selection-criteria-error-1520036-2.patch | 1.42 KB | quinn.mckinsey |
Comments
Comment #1
tlarrieu CreditAttribution: tlarrieu commentedIt looks like the problem is related to the code on those lines looking for array key 'value' when it should be looking for the array key 'tid' for taxonomy. A quick test of changing lines from
155: if (in_array($field_value['value'], $conf_value_array)) {
172: $conf_values[] = $value['value'];
to
155: if (in_array($field_value['tid'], $conf_value_array)) {
172: $conf_values[] = $value['tid'];
Makes the error go away and the taxonomy selection rule works correctly. Of course this is just a data point and not a fix, because it breaks the selection rule for non-taxonomy criteria. A proper fix will need to account for both cases.
Comment #2
quinn.mckinsey CreditAttribution: quinn.mckinsey commentedPatch for this problem.
Applies to ctools-7.x.1.0
Instructions of what to look for:
On one of the content types, for instance articles, add a field called "my tag field" that is of type "Term Reference".
In page manager, choose a variant. Under the Contexts tab, add a "taxonomy vocabulary" or "taxonomy term" to the contexts list. Under the Selection rules tab, choose "Node page: my tag field" and select one of the taxonomy terms. The variant now applies to all articles with the selected taxonomy term in the "my tag field" of the article.
Details for programmers:
Modified "Check field value" section of ctools_entity_field_value_ctools_access_check function to account for 'tid' as a possible key in field_value array. This array now accepts 'value' and 'tid' as possible keys, and an Exception is thrown in all other cases.
Modified "Set conf_values" section of _ctools_entity_field_value_ctools_access_get_conf_field_values function to account for 'tid' as a possible key in value array. This array now accepts 'value' and 'tid' as possible keys, and an Exception is thrown in all other cases.
Personal Notes:
I'm not sure if this patch represents the correct way to fix this problem. It hinges on ctools being aware of 'tid' key, which I'm not sure if ctools provides or if another module provides. However, I figured any solution is better than no solution. Feedback is appreciated.
Comment #3
quinn.mckinsey CreditAttribution: quinn.mckinsey commentedChanging status to needs review.
Comment #4
Kars-T CreditAttribution: Kars-T commentedHi
I did reroll the patch agains latest 7.x branch so that it doesn't use tabs and applies to the coding standard.
Otherwise we use this patch in a project and it works properly. Sadly I can't give an answer if this is the best way to do this. But it seems to be a correct way. And without this it wouldn't work at all...
Comment #5
senortim CreditAttribution: senortim commentedFWIW, I tried using the 7.x-1.x-dev version, but am still seeing these errors. Also, and I'm not sure if this is the same issue, my selection criteria reads "tid equals " and then nothing. The tid is getting saved, and the selector works (even with the non-dev version). I just can't see what it is without drilling all the way down to the setting (i.e., not in the variant summary.)
Comment #6
Anonymous (not verified) CreditAttribution: Anonymous commentedMy post in #1630820: entity_field_value is completely broken tries to solve this. Please try it and comment ?
Comment #7
andypostMarked as duplicate #1558708: Ctools bug in term rule ('tid equals') in Panels Selection rules
#4 is wrong because fields could have more than one storage column
Comment #8
andypostTo actually check the field value ctools should iterate through storage fields and compare them one by one
Comment #9
spuky CreditAttribution: spuky commentedThe patch in #8 solved the Issue for me...
Comment #10
capellicI applied this patch to Dev and it didn't solve my problem. But then my use case is different, I am not using a taxonomy reference field. I am using a List (text) field. My values are:
simple|Simple Page
index|Index Page
multi|Multi-Feature Page
I am trying to select a different Panel variant based on the value in the field. i add the field as a selection rule, select any one of the possible values, save the rule and then I see the error discussed above.
In the "Description" it says "value equals" indicating that the value wasn't recognized. If I go to edit the rule, I see the field with none of the values selected.
Comment #11
andypost@capellic do you have this problem without patch?
Comment #12
Anonymous (not verified) CreditAttribution: Anonymous commentedI applied the patch in #8 and it didn't solve the issue. After the patch applied, I get still same error in same place
Here some debug info:
Comment #13
Anonymous (not verified) CreditAttribution: Anonymous commented#8: 1520036-entity-field-8.patch queued for re-testing.
Comment #14
andypost@emixiak this issue different, see for yours #1630820: entity_field_value is completely broken
Comment #15
merlinofchaos CreditAttribution: merlinofchaos commentedCommitted and pushed andypost's patch.
Comment #17
toddgee CreditAttribution: toddgee commentedPosted a similar defect here:
http://drupal.org/node/1812758
Comment #17.0
toddgee CreditAttribution: toddgee commentedmore errors from same problem