Skip Menu |
 

This queue is for tickets about the WWW-Wikipedia-TemplateFiller CPAN distribution.

Report information
The Basics
Id: 41053
Status: resolved
Worked: 15 min
Priority: 0/
Queue: WWW-Wikipedia-TemplateFiller

People
Owner: diberri [...] cpan.org
Requestors: diberri [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: (no value)
Fixed in: (no value)



Subject: PMCID breaks if PMC->PMID translation fails
Download (untitled) / with headers
text/plain 1.8k
Paraphrased from http://en.wikipedia.org/wiki/User_talk:Diberri/Template_filler: PMCIDs are used indirectly to generate {{cite journal}} templates. The process involves 1) converting a PMCID to a PMID (via W::W::TF::S::PubmedcentralId) and 2) generating a {{cite journal}} template from the PMID (via W::W::TF::S::PubmedId). If no PMID exists for a given PMCID, then step 1 effectively causes an undef to be passed to step 2. And since there is insufficient error handling in the step 2 code, this causes warnings and errors up the wazoo. This was discovered using the web interface, an example for which is given at [1]. Errors include the following: Use of uninitialized value in substitution (s///) at lib/WWW/Wikipedia/TemplateFiller/Source/PubmedId.pm line 30. Use of uninitialized value in string eq at lib/WWW/Wikipedia/TemplateFiller/Source/PubmedId.pm line 33. Use of uninitialized value in substitution (s///) at lib/WWW/Wikipedia/TemplateFiller/Source/PubmedId.pm line 39. Use of uninitialized value in substitution (s///) at lib/WWW/Wikipedia/TemplateFiller/Source/PubmedId.pm line 39. Error executing run mode 'view': Can't call method "url" on unblessed reference at lib/WWW/Wikipedia/TemplateFiller/Source/PubmedId.pm line 42. at /var/www/diberri/cgi-bin/templatefiller/index.cgi line 12 [Tue Nov 18 19:17:49 2008] [error] [client 24.39.185.18] Premature end of script headers: /var/web/cgi-bin/templatefiller/index.cgi The proper behavior would be to gracefully exit in the event that no PMID exists for a given PMCID. This might mean issuing a die() from PubmedId.pm's get() in the event that $pmid is undefined, and trapping this error in a higher-level eval{}, or it might mean going about the error-handling in an entirely different manner. -- David Iberri [1] http://diberri.dyndns.org/cgi-bin/templatefiller/index.cgi?ddb=&type=pubmedcentral_id&id=1247673&add_ref_tag=1&add_text_url=1
Download (untitled) / with headers
text/plain 680b
On Tue Nov 18 21:40:25 2008, DIBERRI wrote: Show quoted text
> The proper behavior would be to gracefully exit in the event that no > PMID exists for a given PMCID. This might mean issuing a die() from > PubmedId.pm's get() in the event that $pmid is undefined, and trapping > this error in a higher-level eval{}, or it might mean going about the > error-handling in an entirely different manner.
Indeed, the most straightforward approach is for W::W::TF::get() to die() when an $id is not given. This is now trapped in an eval within W::W::TF::WebApp, which gives an appropriate error message instead of a "500 internal server error". The bug is fixed in W::W::TF version 0.07. -- David Iberri


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.