When a doi lookup fails because of a bad doi number an error message like this shows

Notice: Trying to get property of non-object in BiblioCrossRefClient->fetch() (line 74 of [path_to_drupal_site]/modules/biblio/modules/crossref/biblio.crossref.client.php).
Notice: Undefined index: biblio_type in biblio_crossref_form_biblio_node_form_submit() (line 78 of [path_to_drupal_site]/modules/biblio/modules/crossref/biblio_crossref.module).

This is pretty ugly for users. The attached patch catches this case and replaces it with an error saying:

Failed to retrieve data for doi [doi id]

CommentFileSizeAuthor
biblio_crossref-ugly_error-1.patch689 bytesdrasgardian

Comments

SandPond’s picture

Priority: Normal » Major

RE: 7.x-1.0-rc5+28-dev; Drupal Core 7.22

My site is producing the same error (see below) when an incomplete or wrong number is used for a DOI lookup.

This will most likely generate help desk calls from our content contributors. I would suggest that this error be trapped and a "DOI Number Not Found or Incorrect" notice be issued instead.

Notice: Trying to get property of non-object in BiblioCrossRefClient->fetch() (line 70 of mywebroot/sites/all/modules/biblio/modules/crossref/biblio.crossref.client.php).
Notice: Undefined index: biblio_type in biblio_crossref_form_biblio_node_form_submit() (line 77 of mywebroot/sites/all/modules/biblio/modules/crossref/biblio_crossref.module).

I don't think this problem was present in the previous version, but I am not certain?

Thanks for all the hard work maintaining Biblio ... a very important module indeed! Recent enhancements in the dev version (listed above) are nice improvements. I especially like the "boldfacing" of citation titles. This was needed, and much welcomed.

rjerome’s picture

Status: Needs review » Fixed

I've applied the patch in the original post...

http://drupalcode.org/project/biblio.git/commit/6828693

Status: Fixed » Closed (fixed)

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