Closed (fixed)
Project:
Bibliography Module
Version:
7.x-1.x-dev
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
5 Mar 2012 at 05:18 UTC
Updated:
16 May 2013 at 02:20 UTC
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]
| Comment | File | Size | Author |
|---|---|---|---|
| biblio_crossref-ugly_error-1.patch | 689 bytes | drasgardian |
Comments
Comment #1
SandPond commentedRE: 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.
Comment #2
rjerome commentedI've applied the patch in the original post...
http://drupalcode.org/project/biblio.git/commit/6828693