Failure to handle DOI and BibTex pre-populate action
| Project: | Bibliography Module |
| Version: | 6.x-1.5 |
| Component: | Code |
| Category: | support request |
| Priority: | critical |
| Assigned: | Unassigned |
| Status: | active |
I assume this is not a bug but a problem with something in my configuration....
Using the DOI Lookup, I get a stream of citation data printed in the head of my page instead of being inserted into the node's fields.
Using the Paste BibTex option, the screen simply refreshes with a blank node input form. Here is the BibTex item (exported straight from EndNote) so you can see the format. Attached is a screenshot of the DOI stream.
Any help greatly appreciated.
>>
@article{
author = {Rujikiatkamjorn, C and Indraratna, B and Chu, J},
title = {2D and 3D Numerical Modeling of Combined Surcharge and Vacuum Preloading with Vertical Drains},
journal = {International Journal of Geomechanics},
volume = {8},
number = {2},
pages = {144-156},
year = {2008}
}
<<
| Attachment | Size |
|---|---|
| biblio-doi-importfailure.png | 219.47 KB |

#1
Sorry: with respect to above...
- Vista/FFox3
- D6.12
- Biblio 6x-1.5
#2
Hmm, I have no idea where that output of the field values could be coming from. I tried both the bibTex you posted and I also entered the DOI from the image and they both worked. See attached image displaying the entry from the DOI import, note the first item in the "New Publications" block on the left is the bibTex Cut and Paste entry.
I suppose you could try installing the -dev version (which is what I am using and tested your file on) and see if that makes any difference.
Are you running your web server on Vista?
Ron.
#3
Ron,
Thanks for the hint, but still no joy. In fact, with the dev version, I don't even get the steam of citation printed at the top of the page.
On submit, the screen simply refreshes, now without either the DOI or BibTex option, and is a blank record ready for input (ie we're at http://railcrc.boab.info/node/add/biblio)
Same result with BibTex import.
I have a couple of CCK fields added to the biblio type, and they run at the top of the node. I wonder if they are causing some sort of havoc?
No, not Vista for webserver...Vista for laptop where I'm running FFox3 working against an Ubuntu/LAMP stack.
Is there anything I can look at to give you a clue? logs somewhere? debug? Nopthing is showing up in watchdog...sorry I can't be more specific: the code level of things is a bit beyond me.
#4
You may be onto something with those CCK fields, I've never tested these attached but I'll do that and see if it makes any difference.
Ron.
#5
Ron,
Sorry to continue with this one, but I'm really stumped.
I have now tried:
- MSIE7, FFox3 and Chrome
- A fresh install of the latest dev (yesterday) with no cck fields...straight out of the box
- Two different crossref accounts (john@boab.info and hearing.crc@gmail.com)
The current behaviour on DOI import is to simply reload the form as an empty node/add/biblio .. no errors, and no imported data.
Any clues? What can I tell you about my installs/environemnt that might clarify?
Thanks indeed....
JB
#6
I'm stumped too and the only way to get to the bottom of this is to start adding some "debugging" code to see what's happening.
If you could edit the biblio_form_validate() function at line 1427 in the biblio.module file and print out the value of $op that would be a start, so after the $op = ... line add a print command as show below. Once this is done, you should try to create a node using a DOI lookup again and it should print out 'Populate using DOI' and stop. If so, that's a good sign, and you will then need to remove the first modification add another line down near 1435 to see what if any data is coming back from the DOI lookup (see second code section below)
function biblio_form_validate($form, & $form_state) {
$op = $form['#post']['op'];
print $op; die; // <---------------------Debug Line
....
$doi = substr($form_state['values']['doi_data'], $doi_start);
$node_data = biblio_crossref_xml_import($doi);
print_r($node_data);die; // <---------------------Debug Line
if (isset($node_data['error'])) {
.....
#7
Maestro,
Thanks for the process.... (working on 10.1002/stc.227)
1. Inserted the first debug and got: Populate using DOI [good]
2. Removed first/Inserted second debug and got a nice data dump:
Array ( [0] => Array ( [biblio_type] => 102 [biblio_secondary_title] => Structural Control and Health Monitoring [biblio_short_title] => Struct. Control Health Monit. [issn] => [biblio_issn] => 15452263 [doi] => 10.1002/stc.227 [month] => 03 [year] => 2008 [biblio_volume] => 15 [biblio_issue] => 2 [biblio_date] => 03/2008 [title] => A review of loading conditions for railway track structures due to train and track vertical interaction [biblio_contributors] => Array ( [1] => Array ( [0] => Array ( [firstname] => Alex M. [lastname] => Remennikov [auth_type] => 1 [name] => Remennikov, Alex M. ) [1] => Array ( [firstname] => Sakdirat [lastname] => Kaewunruen [auth_type] => 1 [name] => Kaewunruen, Sakdirat ) ) ) [biblio_first_page] => 207 [biblio_last_page] => 234 [biblio_pages] => 207 - 234 [biblio_year] => 2008 [biblio_doi] => 10.1002/stc.227 [type] => biblio [comment] => 0 [promote] => [moderate] => [sticky] => [format] => 0 [status] => 1 ) )
3. Removed second debug, ran DOI insert, and got the blank add node form again.
What do I do next?
JB
#8
Ok, that tells us that the DOI lookup was a success (you can see all the information is there). Now for the $64,000.00 question, why isn't it getting back to the form... A little more detective work is required... (By the way, I never asked you what version of PHP you are running, although with Ubuntu I suspect it will be fairly recent)
Could you add the following print statement at the begining of the biblio_form() function at around line 1024...
function biblio_form($node, $form_state) {global $user;
print_r($form_state); // <------------------Debug Line (no "die" statement)
if (isset($form_state['post']['biblio_type'])) {
....
Now the first time you go to create a biblio node you should see something like this at the top of the form...
Array ( [storage] => [submitted] => [post] => Array ( ) )after you enter the DOI and click the populate button, you should see something like this at the top of the form...
Array ( [storage] => [submitted] => [post] => Array ( [doi_data] => 10.1002/stc.227 [op] => Populate using DOI [paste_data] => [biblio_type] => -1 [changed] => [form_build_id] => form-ca717082d2bf3cde81828817842b1247 [form_token] => f716c4cedcd233ce5bf3b317feff848c [form_id] => biblio_node_form ) ) Array ( [storage] => Array ( [biblio_doi] => 1 [biblio_paste] => 1 [biblio_type] => 102 ) [submitted] => 1 [item_count] => Array ( [field_file] => 0 ) [values] => Array ( [nid] => [vid] => [uid] => 1 [created] => 1246323662 [type] => biblio [language] => en [changed] => [doi_data] => 10.1002/stc.227 [op] => Populate using DOI [doi_submit] => Populate using DOI [paste_data] => [paste_submit] => Populate using BibTex [biblio_type] => 102 [title] => A review of loading conditions for railway track structures due to train and track vertical interaction [body] => [format] => 0 [revision] => 0 [log] => [name] => [date] => [status] => 1 [promote] => 1 [sticky] => [submit] => Save [preview] => Preview [form_build_id] => form-b20e261a8af39d6cd8ba6d47cfffdfd6 [form_token] => f716c4cedcd233ce5bf3b317feff848c [form_id] => biblio_node_form [book] => Array ( [menu_name] => [mlid] => 0 [nid] => new [router_path] => node/% [has_children] => 0 [options] => Array ( ) [module] => book [original_bid] => 0 [parent_depth_limit] => 8 [plid] => -1 [weight] => 0 [bid] => 0 [pick-book] => Change book (update list of parents) ) [comment] => 0 [menu] => Array ( [mlid] => 0 [module] => menu [hidden] => 0 [has_children] => 0 [customized] => 0 [options] => Array ( ) [expanded] => 0 [parent_depth_limit] => 8 [link_title] => [parent] => navigation:0 [weight] => 0 ) [upload] => [attach] => Attach [field_test] => Array ( [0] => Array ( [value] => [_error_element] => field_test][0][value ) ) [field_file] => Array ( [0] => Array ( [fid] => 0 [list] => 1 [data] => Array ( [description] => ) [filepath] => [filename] => [filemime] => [filesize] => 0 [_weight] => 0 [filefield_upload] => Upload [filefield_remove] => Remove [upload] => ) [field_file_add_more] => Add another item ) [field_test2] => Array ( [0] => Array ( [value] => [_error_element] => field_test2][0][value ) ) [iid] => [image] => [image_title] => [biblio_secondary_title] => Structural Control and Health Monitoring [biblio_short_title] => Struct. Control Health Monit. [issn] => [biblio_issn] => 15452263 [doi] => 10.1002/stc.227 [month] => 03 [year] => 2008 [biblio_volume] => 15 [biblio_issue] => 2 [biblio_date] => 03/2008 [biblio_contributors] => Array ( [1] => Array ( [0] => Array ( [firstname] => Alex M. [lastname] => Remennikov [auth_type] => 1 [name] => Remennikov, Alex M. ) [1] => Array ( [firstname] => Sakdirat [lastname] => Kaewunruen [auth_type] => 1 [name] => Kaewunruen, Sakdirat ) ) ) [biblio_first_page] => 207 [biblio_last_page] => 234 [biblio_pages] => 207 - 234 [biblio_year] => 2008 [biblio_doi] => 10.1002/stc.227 [moderate] => ) [clicked_button] => Array ( [#type] => submit [#disabled] => [#value] => Populate using DOI [#post] => Array ( [doi_data] => 10.1002/stc.227 [op] => Populate using DOI [paste_data] => [biblio_type] => -1 [changed] => [form_build_id] => form-ca717082d2bf3cde81828817842b1247 [form_token] => f716c4cedcd233ce5bf3b317feff848c [form_id] => biblio_node_form ) [#programmed] => [#tree] => [#parents] => Array ( [0] => doi_submit ) [#array_parents] => Array ( [0] => doi_lookup [1] => doi_submit ) [#weight] => 0.001 [#processed] => [#description] => [#attributes] => Array ( ) [#required] => [#input] => 1 [#name] => op [#button_type] => submit [#executes_submit_callback] => 1 [#process] => Array ( [0] => form_expand_ahah ) [#id] => edit-doi-submit ) [rebuild] => 1 )#9
PHP version=5
Debug: Yes on both counts...here's the result of a DOI lookup:
Array ( [want form] => 1 [args] => Array ( [0] => stdClass Object ( [uid] => 1 [name] => railcrc-sysop [type] => biblio [language] => [body] => [title] => [format] => [status] => 1 [promote] => [sticky] => [created] => 1246334471 [revision] => [comment] => 0 [menu] => Array ( [link_title] => [mlid] => 0 [plid] => 0 [menu_name] => primary-links [weight] => 0 [options] => Array ( ) [module] => menu [expanded] => 0 [hidden] => 0 [has_children] => 0 [customized] => 0 [parent_depth_limit] => 8 ) ) ) [form_load_files] => Array ( [0] => modules/node/node.pages.inc ) [storage] => Array ( [biblio_doi] => 1 [biblio_paste] => 1 [biblio_type] => 102 ) [submitted] => 1 [input] => Array ( [doi_data] => 10.1002/stc.227 [op] => Populate using DOI [paste_data] => [biblio_type] => -1 [field_project_reference] => Array ( [value] => ) [field_biblio_doc] => Array ( [0] => Array ( [fid] => 0 [list] => 1 [_weight] => 0 ) ) [changed] => [form_build_id] => form-cf569c8747270da1d68f6ac0ef897137 [form_token] => cbc5b6125a121830d4c2a4b8f377794c [form_id] => biblio_node_form ) [method] => post [values] => Array ( [nid] => [vid] => [uid] => 1 [created] => 1246334413 [type] => biblio [language] => [changed] => [doi_data] => 10.1002/stc.227 [op] => Populate using DOI [doi_submit] => Populate using DOI [paste_data] => [paste_submit] => Populate using BibTex [biblio_type] => 102 [form_build_id] => form-cf569c8747270da1d68f6ac0ef897137 [form_token] => cbc5b6125a121830d4c2a4b8f377794c [form_id] => biblio_node_form [field_project_reference] => Array ( ) [field_biblio_doc] => Array ( [0] => Array ( [fid] => 0 [list] => 1 [data] => Array ( [description] => ) [_weight] => 0 [filepath] => [filename] => [filemime] => [filesize] => 0 [filefield_upload] => Upload [filefield_remove] => Remove [upload] => ) [field_biblio_doc_add_more] => Add another item ) [biblio_secondary_title] => Structural Control and Health Monitoring [biblio_short_title] => Struct. Control Health Monit. [issn] => [biblio_issn] => 15452263 [doi] => 10.1002/stc.227 [month] => 03 [year] => 2008 [biblio_volume] => 15 [biblio_issue] => 2 [biblio_date] => 03/2008 [title] => A review of loading conditions for railway track structures due to train and track vertical interaction [biblio_contributors] => Array ( [1] => Array ( [0] => Array ( [firstname] => Alex M. [lastname] => Remennikov [auth_type] => 1 [name] => Remennikov, Alex M. ) [1] => Array ( [firstname] => Sakdirat [lastname] => Kaewunruen [auth_type] => 1 [name] => Kaewunruen, Sakdirat ) ) ) [biblio_first_page] => 207 [biblio_last_page] => 234 [biblio_pages] => 207 - 234 [biblio_year] => 2008 [biblio_doi] => 10.1002/stc.227 [comment] => 0 [promote] => [moderate] => [sticky] => [format] => 0 [status] => 1 ) [clicked_button] => Array ( [#type] => submit [#disabled] => [#value] => Populate using DOI [#post] => Array ( [doi_data] => 10.1002/stc.227 [op] => Populate using DOI [paste_data] => [biblio_type] => -1 [field_project_reference] => Array ( [value] => ) [field_biblio_doc] => Array ( [0] => Array ( [fid] => 0 [list] => 1 [_weight] => 0 ) ) [changed] => [form_build_id] => form-cf569c8747270da1d68f6ac0ef897137 [form_token] => cbc5b6125a121830d4c2a4b8f377794c [form_id] => biblio_node_form ) [#programmed] => [#tree] => [#parents] => Array ( [0] => doi_submit ) [#array_parents] => Array ( [0] => doi_lookup [1] => doi_submit ) [#weight] => 0.001 [#processed] => [#description] => [#attributes] => Array ( ) [#required] => [#input] => 1 [#name] => op [#button_type] => submit [#executes_submit_callback] => 1 [#process] => Array ( [0] => form_expand_ahah ) [#id] => edit-doi-submit ) [rebuild] => 1 )
#10
What other modules do you have active? Assuming that was a print of the $form_state variable, it looks like some other module is mucking about with the $form_state array.
#11
Hmm...wish there were a way to query moduels for what services/hooks/variables they interact with. I have no idea...here's my modules list:
Drupal 6.12
Administration menu 6.x-1.4
Advanced help 6.x-1.2
Advanced Profile Kit 6.x-1.0-alpha3
AHAH Response 6.x-1.1
Automatic Nodetitles 6.x-1.1
Backup and Migrate 6.x-1.2
Bibliography Module 6.x-1.x-dev (2009-Jun-27)
Node clone 6.x-1.0
Content Management Filter 6.x-1.6
Collapsiblock 6.x-1.x-dev (2008-Dec-30)
Content Construction Kit (CCK) 6.x-2.4
Content Taxonomy 6.x-1.0-rc1
Chaos tool suite 6.x-1.0-beta3
Date 6.x-2.2
Devel 6.x-1.16
Email Field 6.x-1.2
Exhibit 6.x-1.0-beta1
FileField 6.x-3.0
Flexifield 6.x-1.0-alpha4
Formfilter 6.x-1.x-dev (2008-Dec-16)
getID3() 6.x-1.2
ImageAPI 6.x-1.6
ImageCache 6.x-2.0-beta9
ImageField 6.x-3.0
IMCE 6.x-1.2
Imce CCK Image 6.x-1.0-beta2
Insert View 6.x-1.0
jQuery AOP 6.x-1.0
jQuery Form Update 6.x-1.0
JS Alter 6.x-1.0
Javascript Tools 6.x-1.0
LoginToboggan 6.x-1.5
Masquerade 6.x-1.1
Messaging 6.x-2.1
Node Expire 6.x-1.0
Node import 6.x-1.0-rc4
Nodeaccess 6.x-1.3
Node reference auto-create 6.x-1.x-dev (2009-Jun-13)
Node reference field 6.x-1.x-dev (2009-Jun-13)
Notifications 6.x-2.1
Pathauto 6.x-1.1
Node Relativity 6.x-1.2
Search 404 6.x-1.6
Search Files 6.x-1.6
Service links 6.x-1.0
Taxonomy VTN 6.x-1.2
Taxonomy import/export via XML 6.x-1.3
Token 6.x-1.12
Views 6.x-2.6
Views Bonus Pack 6.x-1.0-beta2
Wysiwyg 6.x-2.0
#12
HOLLY SMOKES!!!! Well that's an impressive list indeed, and all I can tell you is it appears that one of them is changing $form_state from an array to a stdClass Object now the question is which one... My guess is the one which added the first bit with "[want form] => 1"
If you have access to the Unix machine hosting the installation, you could try this from the Drupal installation directory...
grep -R "want form" sites/all/modules/*
replacing "sites/all/modules/*" with where ever your modules are installed of course.
#13
Genius!
I dutifully ran the grep and got:
contrib/ctools/plugins/contexts/node_edit_form.inc: $form_state = array('want form' => TRUE, 'args' => array($node));
contrib/ctools/plugins/contexts/node_add_form.inc: $form_state = array('want form' => TRUE, 'args' => array($node));
contrib/ctools/includes/form.inc: if (!empty($form_state['want form'])) {
contrib/ctools/help/form.html:
ctools (http://drupal.org/project/ctools) is used by a couple of my favourite modules, but I disabled it, ran the DOI lookup and Voila! Ditto with the BibTex paste...
Whew!
So: what is the protocol/process to let MerlinofChaos know that there is some disagreement about how the form state is managed?
Thanks hugely Ron for all the assistance.
And wrt to the list of modules...not sure I'm terribly proud of it. I've been in the drupalverse for less than a year and have zero programming and MySQL skills. So I need a module to do just about anything. And then it's the continuous process of learning their nuances, keeping them updated, and making sure they play nicely together!
We are exercising Biblio though, and have some pretty heavy projects coming up. Are you or others in the commit team available for contract advice/work?
Kind regards,
JB
#14
Hey, good to hear!
I haven't looked at the ctools code in any detail yet, but from a cursory inspection, it would appear that to utilize it correctly, one would have to write a handler for the biblio node type. I have a great deal of respect for programming abilities of MerlinofChaos, and I suspect it's doing what is intended, but I would have to install it and use it a bit in order to make any informed comments further than that.
I guess my question to you is... Do you really need it? It would seem to be still in the beta stages so it's probably not prudent to implement it on a production site.
WRT to contract work, contact me via my contact form and we can discuss that off line.
Cheers,
Ron.
#15
I have pretty much the same problem, however, deactivating ctools hasn't been a success for me. I run the debugs suggested in #6 and got the same results as JB - Populate using DOI and:
Array ( [0] => Array ( [biblio_type] => 102 [biblio_secondary_title] => Expert Systems with Applications [biblio_short_title] => Expert Systems with Applications [issn] => [biblio_issn] => 09574174 [month] => 05 [year] => 2005 [biblio_volume] => 28 [biblio_issue] => 4 [biblio_date] => 05/2005 [doi] => 10.1016/j.eswa.2004.12.039 [title] => A fuzzy logic-based system for assessing the level of business-to-consumer (B2C) trust in electronic commerce [biblio_contributors] => Array ( [1] => Array ( [0] => Array ( [firstname] => F [lastname] => AKHTER [auth_type] => 1 [name] => AKHTER, F ) [1] => Array ( [firstname] => D [lastname] => HOBBS [auth_type] => 1 [name] => HOBBS, D ) [2] => Array ( [firstname] => Z [lastname] => MAAMAR [auth_type] => 1 [name] => MAAMAR, Z ) ) ) [biblio_first_page] => 623 [biblio_last_page] => 628 [biblio_pages] => 623 - 628 [biblio_year] => 2005 [biblio_doi] => 10.1016/j.eswa.2004.12.039 [type] => biblio [comment] => 0 [promote] => [moderate] => [sticky] => [format] => 0 [status] => 1 ) )did then #8 and got:
Array ( [storage] => [submitted] => [post] => Array ( ) )when it's empty but this when I try populating it with the doi:
Array
(
[storage] =>
[submitted] =>
[post] => Array
(
[paste_data] =>
[doi_data] => 10.1016/j.eswa.2004.12.039
[op] => Populate using DOI
[biblio_type] => -1
[changed] =>
[form_build_id] => form-490c6982c3b933f6c7ba08eb0ea134cc
[form_token] => e7b306288ca323b6ab82bcb658757197
[form_id] => biblio_node_form
)
)
It worked at some point but I then installed a couple of more modules and updated a few others (including biblio and cck).
I run Drupal 6.14 and the following modules
Administration menu 6.x-3.0-alpha3
Ajax 6.x-1.14
Bibliography Module 6.x-1.7
Calendar 6.x-2.2
CCK Facets 6.x-1.x-dev (2009-May-02)
Content Construction Kit (CCK) 6.x-2.5
Date 6.x-2.4
Faceted Search 6.x-1.0-beta2
Footnotes 6.x-2.1
Freemind 6.x-1.x-dev (2009-Mar-18)
Link 6.x-2.6
Node Hierarchy 6.x-1.2
Outline Designer 6.x-1.0-rc3
Prepopulate 6.x-1.1
Storm 6.x-1.24
Taxonomy Manager 6.x-2.1
Term Display 6.x-1.1
Thickbox 6.x-1.2
Views 6.x-2.6
Any help would be much appreciated. I'll try rebuilt it on another server and see whether I can identify which module might cause the problem but got to go in a moment.
#16
I've tracked down the problem in my case to CCK fields (number & text) that I added to the Biblio type.
Also, I've come across two issues/bugs that were introduced in Drupal 6.14 due to some changes to the way forms are handled, http://drupal.org/node/302240 and http://drupal.org/node/591696 - it seems as if those will be dealt with in Drupal 6.15 and so for the moment I can live with not having the CCK fields and will revisit the issue when 6.15 is released.
#17
I have a comparable problem with DOI lookup - not working at all: I just get a blank Biblio form again after submitting the DOI. So tried the debugging options starting at #6 and it seems that I'm not getting any lookup data back : (
For info: I have CTools enabled, but no custom CCK fields; the only delta from this thread is that I can post Biblio nodes into Organic Groups (removing Biblio from OG posting had no effect). I do however, have a Frankenstein monster of a Drupal install, so ran the check at #502562-12: Failure to handle DOI and BibTex pre-populate action and only CTools came up. Disabling CTools had no effect at all.
So I'm now not sure if I've set the module/CrossRef info correct, and what should be really easy is not working at all. So I suppose my question is: Is there anymore guidance on configuring the module correctly and linking in to CrossRef? If not, any other ideas as to why the lookup completely fails?
I completed the OpenURL request form at http://www.crossref.org/requestaccount/ and a few days later received an email with a user name and password - although it wasn't clear during registration that I had to wait a few days for such an email. So I've set the correct user name in the biblio settings of my user account... is there anything else? Is there anything that needs to be set in the admin/settings/biblio to complete the DOI lookup? Or is there something else I need to set up with CrossRef? (For example, the CrossRef membership email states 'If your library implements a SFX or other OpenURL-enabled link resolver, please send us your resolver's base URL.' - is this significant?).
In general library systems, OpenURL etc are a new world for me, so please excuse me if I've been a little ignorant, but there didn't seem to be anything relevant in the module documentation.
Grateful for any suggestions - not only do I have to develop the site, I also have to add in 300+ publications as soon as - Faculty are a pretty unforgiving/unhelpful bunch.
#18
It sounds like you have done a lot of the leg work already, so I'm not sure why it's not working. You should only have to enter your "CrossRef OpenURL Account ID: " which in my case was my email address and then it should work.
What version of Drupal are you using? There seems to be some incompatibilities with 6.14, so if you using that version it could be the problem.
Ron.
#19
Thanks - looks like I'll have to sit tight until 6.15 is released and try again.
#20
Alternatively, you could back down to 6.13 and it will probably work.
Ron.