[EP-tech] Possible bug in title_duplicates script?
George Mamalakis
mamalos at eng.auth.gr
Tue Sep 29 14:23:07 BST 2015
Hello everyone,
I'm trying to see if the autocompletion feature works OK with my
multilang fields (like title), and by inspecting script's code, I saw
this in lines 70-80:
my $sql = "SELECT $Q_id" .
" FROM $Q_table" .
" WHERE ";
if ($dataset_name eq "eprint") {
$sql .= " $Q_eprint_status=" . $db->quote_value( "archive" );
}
$sql .= " AND $Q_id!=$id" .
" AND $Q_field_name IS NOT NULL" .
" AND $Q_field_name " .
$db->sql_LIKE() .
$db->quote_value( EPrints::Database::prep_like_value( $q ) . '%' );
As we can see, and if I'm not terribly mistaken, if $dataset_name *neq*
"eprint", then the SQL WHERE statement is immediately followed by an AND
statement, which would cause SQL to fail.
Am I missing something here or is it really a potential bug on non
records not belonging to the "eprint" dataset (not sure how it would be
triggered though)?
--
George Mamalakis
IT and Security Officer,
Electrical and Computer Engineer (Aristotle Univ. of Thessaloniki),
PhD (Aristotle Univ. of Thessaloniki),
MSc (Imperial College of London)
School of Electrical and Computer Engineering
Aristotle University of Thessaloniki
phone number : +30 (2310) 994379
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ecs.soton.ac.uk/pipermail/eprints-tech/attachments/20150929/bf55852d/attachment.html
More information about the Eprints-tech
mailing list