When pasting a new entry (e.g. bibtex) to captcha protected biblio without actually entering the captcha --> Invalid Arg

oligochaeta - November 11, 2009 - 17:38
Project:Bibliography Module
Version:6.x-1.7
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active
Description

dear rjerome,

first of all thanks for this great module. I'm using it on two websites and am very happy with it. Nonetheless I've got a feature request and (probably) two bugs:

1. I want to allow anonymous users to submit their papers etc. to biblio without registering. The DOI field cannot be switched off in the administration pages for anonymous users, but one can only use DOI lookup when logged in (due to the CrossRef-identity). I've edited the code in biblio.module:

Line 1038:
// only show the doi lookup and paste boxes if this is a new entry. Edit oligochaeta: And also don't show DOI for anonymous
if(phpversion() > 5 && !isset($form_state['storage']['biblio_doi']) && !($user->uid === 0) ) {
(was:
if(phpversion() > 5 && !isset($form_state['storage']['biblio_doi']) ) {

Do you think this ok?

kind regards, oligochaeta

#1

rjerome - November 11, 2009 - 18:03

Yes, That's a very good idea. I hadn't thought of the case where anonymous users might be entering data.

I'll include that in the code.

Ron.

P.S. What are your "two bugs"???

#2

rjerome - November 11, 2009 - 18:10
Status:active» fixed

Committed to CVS... http://drupal.org/cvs?commit=287724

#3

oligochaeta - November 11, 2009 - 19:13
Title:Don't show DOI field to anonymous users when creating new entries» When pasting a new entry (e.g. bibtex) to captcha protected biblio without actually entering the captcha --> Invalid Arg
Category:feature request» bug report

Dear Ron,

thanks a lot for your fast response to the thread at http://drupal.org/node/629960

Here's my "bug promise" -- though I'm not sure, if this is a biblio or a captcha module issue:

I want to allow anonymous users to paste bibtex entries to biblio (via the paste function). For spamming reasons the form is captcha protected. If one then submits the pasted bibtex entry without actually entering the captcha the form is reloaded as it should, stating one should enter the correct captcha. The bibtex text still shows up in the "paste"-field of the form. If one then enters the correct captcha, an error message is generated:

warning: Invalid argument supplied for foreach() in /modules/biblio/biblio.module on line 1135.
and no new entry is processed.

If I immmediately enter the correct captcha, the entry is processed correctly. I haven't found out up to now, where the problem is.

Thanks for your help and greetings, Chris

PS: My second "bug" - not sure if this really is one:

In biblio.module in line 27:

$db_res = db_query("SELECT * FROM {biblio_contributor_type");

shouldn't this be:

$db_res = db_query("SELECT * FROM {biblio_contributor_type}");

(closing curled bracket after "biblio_contributor_type")?

#4

oligochaeta - November 11, 2009 - 19:29
Status:fixed» active

Sorry, I think I should have opened a separate bug and not answering to the previous thread - now it looks like being fixed already. I change the status to "active".

#5

rjerome - November 11, 2009 - 20:41

I'm not sure about Bug #1, I'll have to install captcha and test it out.

Bug #2 is already fixed in the -dev version.

 
 

Drupal is a registered trademark of Dries Buytaert.