Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi,
I'm using the Image Attach module and have book cover images attached to biblios. I'm working on upgrading the site from Drupal 5 to Drupal 6 and when I go to create a new View of the type "Biblio", I don't get attached images as one of my available fields in the View.
I'm not sure how complicated this would be; I tried converting a Views 1 view with attached images and nothing shows up. Here's the query that gets built in the converted View:
SELECT node.nid AS nid,
image_attach.iid AS image_attach_iid,
node.title AS node_title,
vid,
biblio_type AS biblio_tid,
node.created AS node_created
FROM node node
INNER JOIN term_node term_node ON node.vid = term_node.vid
LEFT JOIN image_attach image_attach ON node.nid = image_attach.nid
WHERE (node.status <> 0) AND (term_node.tid = 350) AND (node.type in ('biblio'))
ORDER BY node_created DESC
I'd be happy to work on providing a patch if you can point me in the right direction.
Thanks!
Comment | File | Size | Author |
---|---|---|---|
#1 | biblio.views-image_attach-support.patch | 459 bytes | John Bickar |
Comments
Comment #1
John Bickar CreditAttribution: John Bickar commentedOK, not sure if this is the right way, but here's a patch extending hook_views_data_alter() that provides this functionality.
Comment #2
rjerome CreditAttribution: rjerome commentedI'm beginning to think that the 6.x views implementation may be flawed in that it declares biblio as "Base" type when in fact it's really an extension of the node type. I'm going to revisit this, other wise these sorts of patches are going to be required for every other node content type, and I don't think that's how it's supposed to work :-(
Stay tuned...
Ron.
Comment #3
John Bickar CreditAttribution: John Bickar commentedThanks, Ron. I've been digging through the Views 2 API the last couple of days and (as you can see) have garnered just enough knowledge to make me dangerous :)
I'll be interested to see how this develops, and what the tradeoffs are in having a "biblio" type vs. having biblio be an extension of the "node" type.
Will be happy to help test out as things progress.
Comment #4
aboros CreditAttribution: aboros commentedDear Ron,
My problem is somewhat similar to this issue.
I've added a node_reference field to biblio content type, referencing nodes of content profile. (user bios) Now I need to create a view which should show a block on bio pages with the "publications" referencing to that node. I struggled with it a lot with no success.
The problem is that views integration creates a new view type and therefore other CCK fields or relationships are not present in biblio views. This is definitely wrong this way.
I am very happy about biblio views integration, but I think it is started in a wrong direction. Biblio shouldn't create a new view type, it should expose its custom fields into the basic node view type.
Comment #5
rjerome CreditAttribution: rjerome commentedYes, as I mentioned in comment #2, I am aware of this issue. Unfortunately, I haven't had a chance to look at this yet, but it's coming soon.
Ron.
Comment #6
rjerome CreditAttribution: rjerome commentedI just checked in some changes to the Views implementation which should address these issues. You will find them in the next -dev build. There is much more to come on the Views front, but this is a start (and I think it's got me hooked on views :-)
Comment #7
rjerome CreditAttribution: rjerome commentedFurther to this... I just checked in another addition to the Views implementation which adds a "pseudo" field to the biblio field list called "Biblio Citation" which when selected will render a complete citation based on the given nid criteria.
So you now have access to all the individual components that make up a citation AS WELL AS the complete formatted citation.
Cheers,
Ron.
Comment #8
John Bickar CreditAttribution: John Bickar commentedW00t!
Will test this on Monday.
Comment #9
aboros CreditAttribution: aboros commentedawesome!
no bugs so far, i'll test it more and report bugs if any.
many thanks, great job!
Comment #10
John Bickar CreditAttribution: John Bickar commented*cheers go up across the land*
Nice work, very solid.
I'm noticing one thing, however: When I expose the Authors field, even with "Output this field as a link" unchecked, they're being output as links.
I think there's another issue in the queue about the Authors field, so I'll see if I should post there (more appropriately).
Thanks Ron!
Comment #11
Aren Cambre CreditAttribution: Aren Cambre commentedWhile Ron has provided a partial solution, full resolution probably available through #682044: Support fields (CCK) in D7 Bibliography Module, so marking as duplicate.