Dear all,

when opening a users personal publications page, e.g.: biblio/author/276 it doesn't only show the items the person is author off but also those that the person is editor of.
While this might be right for some - it isn't for me. How can I modify/fix/improve this?

I looked at the 'author' query in biblio.pages.inc biblio_build_query(), but its somewhat confusing.

Thanks everyone and happy coding.

Comments

rjerome’s picture

You would have to add a "where" limit to the query in the "author" section...

        case 'author':
          $bcc++;
          $term = explode("?",array_shift($arg_list));

          if (is_numeric($term[0])){
            $joins[] = "inner join {biblio_contributor} as bc". $bcc ." on n.vid = bc". $bcc .".vid";
            $cids = db_query('SELECT cid FROM {biblio_contributor_data}
                              WHERE cid = %d OR aka = (SELECT aka FROM {biblio_contributor_data} WHERE cid = %d)'
                              ,$term[0], $term[0]);
            while ($cid = db_fetch_object($cids) ){
              $wr .= empty($wr)?'':' OR ';
              $wr .= "bc". $bcc .".cid = $cid->cid ";
            }
            $where[] = (!empty($wr)) ? $wr : "bc". $bcc .".cid = -1 ";
            $where[] = 'bc.auth_category=1';
          }else{
            $where[] = " bcd". $bcc .'.name '. $match_op .' "[[:<:]]%s[[:>:]]" ';
            $joins[] = " JOIN {biblio_contributor} as bc". $bcc ." on b.vid = bc". $bcc .".vid ";

Note the new line "$where[] = 'bc.auth_category=1';" just before the {else}

Ron.

nhck’s picture

Category: support » feature

Wow speedy! Thank you very much!

Actually it was ;-)

$where[] = "bc". $bcc .".auth_category = 1 ";

Should this be an option? Maybe? I think I could make a patch including an options panel.

rjerome’s picture

Right you are, I hadn't actually "tested" the code I posted :-(

WRT an optional setting, that's probably a good idea, although you are the first to raise it.

Ron.

freggy’s picture

This problem still exists in the version for drupal 7: when looking for publications of a certain author, I do not want the publications of which that person was the editor.

I found a comment line:
// $query->condition('bc.auth_category', 1);
but uncommenting this, does not seem to change anything. How can I only see the publications that person is really the author of, and not the editor?

rjerome’s picture

I'm revisiting all that filtering code (as there are some other issues as well, #1399866: Filtering publications always returns zero results) so I'll look at this at the same time.

liam morland’s picture

Issue summary: View changes
Status: Active » Closed (outdated)

This version is no longer maintained. If this issue is still relevant to the Drupal 7 version, please re-open and provide details.