Closed (fixed)
Project:
Views (for Drupal 7)
Version:
7.x-3.x-dev
Component:
fieldapi data
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
14 Apr 2011 at 22:24 UTC
Updated:
29 Apr 2011 at 01:31 UTC
Jump to comment: Most recent file
Comments
Comment #1
merlinofchaos commentedWhat is $item['raw'] in this case? Typically it's an array from the table, and Views is trying to match the 'columns' to the 'raw' data so that users can use tokens.
I guess my assumption that this would always be the case is clearly false.
Comment #2
katbailey commentedOh what the heck - adding a patch that just reverts the above change purely for my own drush make purposes ;-)
Comment #3
merlinofchaos commentedIf you tell me that it's basically the db fetched as an object and not an array, then a bit of code that tests is_array vs is_object can alleviate that. Cross fingers!
Comment #4
dawehnerMh this is a 1to1 revert of #1109532: Image Field alt/title tokens do not get displayed
This will 100% not work because $item['raw'] will never be a scalar, so the tokens will not work.
raw can be everything. For example and stdClass, a real object or an array where for example 'value' exist.
So we really have to look at it, here is a patch.
Comment #5
katbailey commentedYes, works for me - thanks!
Comment #6
dawehnerOkay what about use ['raw']->{$id} if it's an object.
Comment #7
katbailey commentedHmm, well the keys of the columns array are fid, title and data, but ['raw']->title and ['raw']->data aren't set so I'm getting undefined property errors. I'll try and re-work the logic and see what I come up with...
Comment #8
katbailey commentedWould this fly? It works for my purposes without errors.
Patch attached
Comment #9
merlinofchaos commentedThat should do it, I think.
Committed, thank you!