Problem/Motivation

Using the latest 7.x-1.x-dev, we are trying to create a view of publications with exposed filters.
One of the exposed filters we want to use is the Biblio Drupal UserID, to allow us to expose only those contributors who are also Drupal users on the site. This simply does not work. The dialogue overlay when adding or editing the filter criteria does not list the users, and exposing it therefore shows no form.

Proposed resolution

Fix it - which I think I have, patch to follow.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Finn Lewis’s picture

Status: Active » Needs review
FileSize
1.27 KB

I have this working locally, by changing the filter handler in biblio.views.inc from

$data['drupal_uid'] =  array(
    'field'     => array('handler' => 'views_handler_field'),
    'filter'    => array('handler' => 'views_handler_filter'),
    'argument'  => array('handler' => 'views_handler_argument_numeric'),
    'relationship' => array(
      'handler' => 'views_handler_relationship',
      'base' => 'users',
      'base field' => 'uid',
      'label' => t('user'),
    ),

to

$data['drupal_uid'] =  array(
    'field'     => array('handler' => 'views_handler_field'),
    'filter'    => array('handler' => 'biblio_handler_filter_contributor_uid'),
    'argument'  => array('handler' => 'views_handler_argument_numeric'),
    'relationship' => array(
      'handler' => 'views_handler_relationship',
      'base' => 'users',
      'base field' => 'uid',
      'label' => t('user'),
    ),

And in biblio_handler_filter_contributor_uid.inc, changing the value_options to use $row->drupal_uid rather than $row->cid.

Patch against current 7.x-1.x-dev attached

rjerome’s picture

Hmmm, that was strange. Looks like I got half way through implementing that feature, then never finished.

It's committed now... http://drupalcode.org/project/biblio.git/commit/266ab64

Ron.

rjerome’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.