Reviewed & tested by the community
Project:
Exhibit
Version:
6.x-1.0-beta1
Component:
Data sources
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
24 Aug 2009 at 18:02 UTC
Updated:
11 Sep 2012 at 13:29 UTC
Jump to comment: Most recent file
Comments
Comment #1
mariagwyn commentedSimilar error. Using 'list all terms' in View feed, which displays fine in view. However, in Exhibit, the field '.tid' contains only [object Object].
This error appears on both Views 2.x-dev and 3.x-dev.
2.6 is fine.
Comment #2
mariagwyn commentedany possibility of this being addressed? The views 2.x-dev version has some features I would like to continue to use, so I would prefer not to have to revert to 2.6. But, I am using exhibit for a key page. Any thoughts?
Thanks!!!
Comment #3
mariagwyn commentedA friend a developer came up with a patch which fixes the problem. Not the cleanest, but it works. I have attached it. Improvements welcome!
Comment #4
tinkalink commentedHi,
After installing the patch, I get the error:
warning: Invalid argument supplied for foreach() in ../sites/all/modules/exhibit/contrib/exhibit_views/views_plugin_style_exhibit_json.inc on line 128.
Using php 5.3 and views 6.3-dev
Any ideas?
Comment #5
diodata commentedThe warning probably comes in because of the value in the foreach statement is empty. Just check to see if it exists first. The above patch would look something like:
Of course, this code/patch only works if the base field name within the view is "tid". Many times when creating a view, you bring in taxonomy values multiple times. This would result in the names being tid_1, tid_2, etc... In that case, you would need to repeat the above code, replacing tid with tid_1, and so on. I checked my own sites and usually don't go over tid_4. So, I have this code snippet repeated five times, from tid through tid_4.
This is definitely NOT an ideal solution, or even a good one. But it solves the problem until a new version of the module is released. I'm thinking there will be numerous updates/changes in the new module. Spending a lot of time on creating a patch against the current dev release (May 1, 2009) may not make much sense at this point.
Comment #6
diodata commentedI should add the problem exists in Views 2.8+.
Comment #7
toby.batch commentedI have a patch that I'm using that works against (potentially) any number of taxonomy (tid) fields
Comment #8
jcamfield commentedThis is still a problem; made more annoying by the Views security release. The patches got me to new and interesting errors claiming that my JSON file was improperly formatted (doesn't seem to be.)
Reverting to good ol' Views 2.6 (http://drupal.org/node/488082) worked.
Comment #9
hachreak commentedI have test last submitted patch and comment unknow function "broads_debug_to_syslog".
Now, i think that it correctly use taxonomy.. :-p
Comment #10
jrc commentedThere is a similar problem for node reference fields. A simple addition to the first line of the suggested patch appeared to do this trick for me. It just grabs the last three characters of "group_nid" in the feed.
if (!empty($key) && strlen($key)>=3 && (substr($key,0,3)=='tid' || substr($key,-3,3)=='nid')) {Comment #11
nicolash commentedThe patch in #9 works. However, can somebody with more Exhibit JS experience say whether it would be possible to solve this via JS? All the taxonomy data is there in the JSON, it just gets wrapped up in a nested element.
Throwing all the term data away on the PHP level seems the wrong way of going about it...all that extra info could be useful for further custom scripting.
I tried to access the taxonomy term name like this:
but unfortunately that didn't work. The JS syntax is correct, I believe, but Exhibit doesn't seem to support using nested elements for this functionality.
Comment #12
jcamfield commentedI cannot get #9 to work for me - I'm applying it against exhibit-views.inc, and it throws an error when applied:
Invalid argument supplied for foreach() in .../modules/exhibit/exhibit.views.inc on line 41.
Line 41 in this case is foreach ($items[$row->$base_field] as $key => $value) , using Views 3 alpha4. and the dev branch.
I am using multiple TIDs in my view, however.
Comment #13
dominikb1888 commented@jcamfield: check the patch from #3 it is originally applied to "views_plugin_style_exhibit_json.inc". The patch from #9 works fro me the addtion from #10 as well. Tested and in use in multiple live environments. Needed to apply #9 and #10 manually though.
Comment #14
jcamfield commentedAlright, I'm being dense here. I've applied the patch in #9 against /sites/all/modules/exhibit/contrib/exhibit_views ; edited its first line as per #10, and also applied #3 for good measure. I'm using Exhibit 6.x-1.x-dev and Views 6.x-3.0.
With all of this, I get one working taxonomy selector, but the rest are all NN [Object Object] : http://www.audreyandjon.com/recipes/box
The key seems to be in #3, which only addresses one tid field, whereas my view presents tid, tid_1, tid_2, tid_3....
Any help would be appreciated; my code skills are long rusted over at this level.
Comment #15
jcamfield commentedAha! Post-caffeine hacking > pre-caffeine hacking.
Taking the patch from #3 and extending it to cover multiple tids. I'm sure there's a more elegant way to do this, but:
Where this is the #3 patch against sites/all/modules/exhibit/contrib/exhibit_views/views_plugin_style_exhibit_json.inc
Add additional
Having more tid_Ns does not seem to break the JSON, as they're conditional.