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!

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

John Bickar’s picture

OK, not sure if this is the right way, but here's a patch extending hook_views_data_alter() that provides this functionality.

rjerome’s picture

Status: Active » Needs review

I'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.

John Bickar’s picture

Thanks, 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.

aboros’s picture

Dear 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.

rjerome’s picture

Yes, 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.

rjerome’s picture

I 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 :-)

rjerome’s picture

Further 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.

John Bickar’s picture

W00t!

Will test this on Monday.

aboros’s picture

awesome!
no bugs so far, i'll test it more and report bugs if any.

many thanks, great job!

John Bickar’s picture

*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!

Aren Cambre’s picture

Status: Needs review » Closed (duplicate)

While Ron has provided a partial solution, full resolution probably available through #682044: Support fields (CCK) in D7 Bibliography Module, so marking as duplicate.