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.
The default CCK field handler (views_handler_field_content) adds the node type field to the view query because several formatters rely on its presence. However, it incorrectly assumes that the field's table alias is 'node' for fields that are included in the view via a relationship (as is potentially the case when using Content Profile).
I've created a patch that checks the relationship of the field and correctly adds the node type field to the query based on it. Please review the patch and consider rolling into core.
Comment | File | Size | Author |
---|---|---|---|
#3 | updated_cck_views_field_handlers_2.patch | 780 bytes | jhuckabee |
updated_cck_views_field_handlers.patch | 736 bytes | jhuckabee |
Comments
Comment #1
yched CreditAttribution: yched commentedMakes sense.
Isn't there a more direct way than
$this->view->display['default']->handler->handlers['relationship'][$this->options['relationship']]
to access this info ? I know that information is duplicated in the view.Comment #2
yched CreditAttribution: yched commentedOK, I committed something along those lines. Thanks !
Comment #3
jhuckabee CreditAttribution: jhuckabee commentedYou may have already caught this, but I just found a bug with this patch. It fails to properly check the 'none' relationship case. I've attached an updated patch.
Should be
instead of just
Comment #4
yched CreditAttribution: yched commentedActually, no, I had not caught this. Thanks.
Comment #5
yched CreditAttribution: yched commentedAfter talking with merlinofchaos, it appears 'additional fields' take care of relationships, so I eventually committed a different fix for this.
Thanks for pointing this, though.
Comment #6
Anonymous (not verified) CreditAttribution: Anonymous commentedAutomatically closed -- issue fixed for two weeks with no activity.