lter / deims

The Drupal Ecological Information Management System install profile. Repo used for development.
http://drupal.org/project/deims
9 stars 16 forks source link

Persons to Biblio Authors Issue #62

Open isangil opened 9 years ago

isangil commented 9 years ago

Turns out it is not so easy to connect the publications of a Person through the author.

The logic we followed is, if we connect the biblio "authors" (cids) with the Persons (nids), all the desired functionality would follow, specially, rendering a list of pubs associated with a Person.

Not so.

I ran into issues at the 'rendering pubs' step.

At the Person form, we connect "OK" the authors, although, the "Node Autocomplete" widget does not show the labels of the authors cids, instead, shows a --restricted access--. It still allows you to pick one of the 'restricted access' author cids, and it is ok-ish, when you narrow it down to your cid (an exact match). Likewise, all attempts to render the author cid label in the person form or a view end in the - Restricted access - It all points to a permission problem, which may be a consequence of biblio not following the field API, entity API -- it is a port from the early Drupals. (but this is another story).

Anyway, we need to get to the desired functionality. There's got to be a way -- it all works with users and author cids, but likely the biblio maintainers coded this in an ad-hoc way. Any takers most welcome!

jlaundre commented 9 years ago

One way I am able to get the the autocomplete to show author names is to use an Entity Reference view instead of Simple under the "Entity Selection Mode" .

I still can't figure out a way to get it to link Associated Biblio Author to the pubs list. I can add a new token field and put a href="/biblio?f[author]=[node:field_associated_biblio_author]">Publications</a
and it works if the person has an Associated Biblo Author (using the full name). It doesn't work if the token is empty (returns a string: "[node:field_associated_biblio_author]") or if the biblo author's name is not formatted correctly, e.g. full name is Smith, A. instead of A. Smith.

It would be better to get the author cid but so far I have not figured out how.

isangil commented 9 years ago

Thanks for the tip on "show author names", very useful.

Problem with views and biblio may trace back to the architecture of Biblio. A wonderful module, feature rich, and functional, but it does not use the Drupal Core field as of D7. It is actually inspired on the Drupal 5 architecture, and while it performs well, it does not integrate/leverage well many of the added features of Drupal (migrate, the entity framework, the field framework, views, etc). As a famous Drupal guru put it "Biblio does its own thing", being a bit monolithic. Palantir offered to push the effort to revamp Biblio to use fields (an effort is underway), but we deemed to 'expensive' for our modest funds, and ambitious project with large backlog. So we chose to do other stuff.

I will post progress on workarounds -- the main goal here is of course to peg the publication list to the authors (specifically, DEIMS persons) as automatically as possible. Thanks Jim!

jlaundre commented 9 years ago

Yes it is difficult to see what biblo is doing.

Below is the Entity Reference view export that I used. You can see it being use on http://arc-lter.ecosystems.mbl.edu/edward-rastetter The Publications is the token field.

Although I am thinking that a block to list just the most recent pubs would be better. I am still trying to wrap my head around views though.

Jim

$view = new view(); $view->name = 'biblo_author_link'; $view->description = ''; $view->tag = 'default'; $view->base_table = 'biblio_contributor_data'; $view->human_name = 'biblo_author_link'; $view->core = 7; $view->api_version = '3.0'; $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */

/* Display: Master _/ $handler = $view->new_display('default', 'Master', 'default'); $handler->display->display_options['use_more_always'] = FALSE; $handler->display->display_options['access']['type'] = 'none'; $handler->display->display_options['cache']['type'] = 'none'; $handler->display->display_options['query']['type'] = 'views_query'; $handler->display->display_options['exposed_form']['type'] = 'better_exposed_filters'; $handler->display->display_options['pager']['type'] = 'full'; $handler->display->display_options['style_plugin'] = 'default'; $handler->display->display_options['row_plugin'] = 'fields'; $handler->display->display_options['row_options']['inline'] = array( 'cid' => 'cid', 'name' => 'name', 'contextual_links' => 'contextuallinks', ); / Field: Biblio: Author full name */ $handler->display->display_options['fields']['name']['id'] = 'name'; $handler->display->display_options['fields']['name']['table'] = 'biblio_contributor_data'; $handler->display->display_options['fields']['name']['field'] = 'name'; $handler->display->display_options['fields']['name']['label'] = ''; $handler->display->display_options['fields']['name']['alter']['text'] = 'Publications [name]'; $handler->display->display_options['fields']['name']['alter']['path'] = '/biblio?f[author]=[cid]'; $handler->display->display_options['fields']['name']['element_label_colon'] = FALSE;

/* Display: Entity Reference */ $handler = $view->new_display('entityreference', 'Entity Reference', 'entityreference_1'); $handler->display->display_options['defaults']['title'] = FALSE; $handler->display->display_options['title'] = 'Biblio_link'; $handler->display->display_options['pager']['type'] = 'some'; $handler->display->display_options['defaults']['style_plugin'] = FALSE; $handler->display->display_options['style_plugin'] = 'entityreference_style'; $handler->display->display_options['style_options']['search_fields'] = array( 'name' => 'name', 'cid' => 0, ); $handler->display->display_options['defaults']['style_options'] = FALSE; $handler->display->display_options['defaults']['row_plugin'] = FALSE; $handler->display->display_options['row_plugin'] = 'entityreference_fields'; $handler->display->display_options['row_options']['inline'] = array( 'cid' => 'cid', 'name' => 'name', ); $handler->display->display_options['defaults']['row_options'] = FALSE;

----- Original Message -----

From: "Inigo San Gil" notifications@github.com To: "lter/deims" deims@noreply.github.com Cc: "jlaundre" jlaundre@mbl.edu Sent: Wednesday, March 11, 2015 10:17:19 AM Subject: Re: [deims] Persons to Biblio Authors Issue (#62)

Thanks for the tip on "show author names", very useful. Problem with views and biblio may trace back to the architecture of Biblio. A wonderful module, feature rich, and functional, but it does not use the Drupal Core field as of D7. It is actually inspired on the Drupal 5 architecture, and while it performs well, it does not integrate/leverage well many of the added features of Drupal (migrate, the entity framework, the field framework, views, etc). As a famous Drupal guru put it "Biblio does its own thing", being a bit monolithic. Palantir offered to push the effort to revamp Biblio to use fields (an effort is underway), but we deemed to 'expensive' for our modest funds, and ambitious project with large backlog. So we chose to do other stuff. I will post progress on workarounds -- the main goal here is of course to peg the publication list to the authors (specifically, DEIMS persons) as automatically as possible. Thanks Jim! — Reply to this email directly or view it on GitHub .

isangil commented 9 years ago

Nice! Thanks Jim!