Description says it all. Tested with latest dev and alpha10
If you use these fields, your view returns no results period:
- Node Gallery Image: Cover View
- Node Gallery Image: Image Image
- Node Gallery Image: Image weight Image weight
If you use these fields, your view returns incorrect results:
- Node Gallery: Image Count Image Count (returns the first result only, repeats it)
- Node Gallery: Gallery ID Gallery ID (returns the first result, repeats it, returns cover image rather than GID)
- Node Gallery: Gallery Operations Gallery Operations (first result repeating)
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | 625528.node_gallery.views-cover-image-relationship.patch | 3.54 KB | joachim |
Comments
Comment #1
lukevr commentedthe same in alpha11!
Critical.
Comment #2
designwork commentedI will have a look.
Comment #3
designwork commentedHi justintime,
I changed the function pre_render(&$values) in the node_gallery_handler_field_gid.inc. For me I can work with it without any problem. No broken views any more with views 2.
Here comes my function:
Can some one please test it?
Cheers
Dirk
Comment #4
justintime commentedCan someone export a view, or can one of the OP's verify this fix works? I never had a problem, so I'm not a good tester, plus I'm busy setting up some CI goodness for NG*.
@DesignWork, the code looks pretty sound, save for two things.
Comment #5
designwork commentedHi justintime,
What means "looks pretty sound"? But anyway I was not ready testing everything (node_gallery_access).
I had no Problem with views as well so I crated one. I made all my images is_cover = 0 in the database. So the sql statement will give me an an empty result. And than I got a lot of problems with the view_handlers.
As I know there is no need to have a "cover" in node_gallery. So I thought we just ingnore it and just turn back any Image. But to be honest we should if there is a cover return it and if not return any image.
No it is there just make a print_r($value). Views magic!
Comment #6
designwork commentedHi justintime,
I made a view with two gallery types (Gallery and Photo Gallery) as Fliter. This breaks any view as well.
here comes the view.
Comment #7
dddave commentedFor reference:#613988: Views (again): Gallery Image size
Comment #8
joachim commentedThe way to do this properly is to provide a relationship that gives you the cover node for the given gallery node.
In other words, a Views relationship that goes from gallery_image back to node, but only picking the single node that is the cover. So your tables connect like this:
node (base of the view) ---(nid = gid)--- node_gallery ---(nid = nid, where is_over = 1)--- node (cover image)
You can then add any fields for nodes on the relationship to get title, image output, date created, etc etc.
Here is a patch with that.
I've also taken the liberty of:
- changing the label of the current 'cover image' field, because that only gets you a boolean
- adding some code comments for views data sanity ;)
Comment #9
justintime commentedthanks @joachim. That's how I did in in NG3.x-dev -- you're pretty brave diving into 2.x views code! I don't have the time to review it, but I know there's plenty of people wanting better views integration on their 2.x installs. If I get a few reports of RTBC, then I'll commit this into 2.x-dev (as well as your other views patch at #613988: Views (again): Gallery Image size.
Comment #10
dddave commented@ALL
NG3 has awesome views integration. If somebody has to live with NG2 for the upcoming time you might want consider testing this patch and reporting back. Apart from ready-to-commit fixes I doubt there will be any further love for NG2 from this point on.
Comment #11
dddave commentedNG2 is basically dead. Use NG3!