<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">Ah,<br>
      <br>
      And of course the obvious solution would be to change the location
      of the first AND statement, so a patch similar to this:<br>
      <br>
          $sql .= " $Q_eprint_status=" .  $db-&gt;quote_value( "archive"
      ) . " AND ";<br>
      <br>
      --- ./cgi/users/lookup/title_duplicates    2015-04-17
      19:07:54.000000000 +0300<br>
      +++ /tmp/title_duplicates    2015-09-30 10:45:40.510270944 +0300<br>
      @@ -71,9 +71,9 @@<br>
           " FROM $Q_table" .<br>
           " WHERE ";<br>
       if ($dataset_name eq "eprint") {<br>
      -    $sql .= " $Q_eprint_status=" .  $db-&gt;quote_value(
      "archive" );<br>
      +    $sql .= " $Q_eprint_status=" .  $db-&gt;quote_value(
      "archive" ) . " AND ";<br>
       } <br>
      -$sql .=    " AND $Q_id!=$id" .<br>
      +$sql .=    "$Q_id!=$id" .<br>
           " AND $Q_field_name IS NOT NULL" .<br>
           " AND $Q_field_name " .<br>
           $db-&gt;sql_LIKE() .<br>
      <br>
      <br>
      Before opening a bug report in EPrints' github, please someone do
      confirm that what I'm suggesting is not breaking things instead of
      fixing them.<br>
      <br>
      Cheers,<br>
      <br>
      George.<br>
      <br>
      On 29/09/2015 04:23 μμ, George Mamalakis wrote:<br>
    </div>
    <blockquote
cite="mid:EMEW3|d022f2d072aaee2c2d142b3c91f3ce35r8SENb14eprints-tech-bounces|ecs.soton.ac.uk|560A90BB.3020709@eng.auth.gr"
      type="cite">
      <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
      Hello everyone,<br>
      <br>
      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:<br>
      <br>
      my $sql = "SELECT $Q_id" .<br>
          " FROM $Q_table" .<br>
          " WHERE ";<br>
      if ($dataset_name eq "eprint") {<br>
          $sql .= " $Q_eprint_status=" .  $db-&gt;quote_value( "archive"
      );<br>
      }<br>
      $sql .= " AND $Q_id!=$id" .<br>
          " AND $Q_field_name IS NOT NULL" .<br>
          " AND $Q_field_name " .<br>
          $db-&gt;sql_LIKE() .<br>
          $db-&gt;quote_value( EPrints::Database::prep_like_value( $q )
      . '%' );<br>
      <br>
      <br>
      As we can see, and if I'm not terribly mistaken, if $dataset_name
      <b>neq</b> "eprint", then the SQL WHERE statement is immediately
      followed by an AND statement, which would cause SQL to fail.<br>
      <br>
      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)?<br>
      <br>
      <pre class="moz-signature" cols="72">-- 
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


</pre>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">*** Options: <a class="moz-txt-link-freetext" href="http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech">http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech</a>
*** Archive: <a class="moz-txt-link-freetext" href="http://www.eprints.org/tech.php/">http://www.eprints.org/tech.php/</a>
*** EPrints community wiki: <a class="moz-txt-link-freetext" href="http://wiki.eprints.org/">http://wiki.eprints.org/</a>
*** EPrints developers Forum: <a class="moz-txt-link-freetext" href="http://forum.eprints.org/">http://forum.eprints.org/</a>
</pre>
    </blockquote>
    <br>
    <br>
    <pre class="moz-signature" cols="72">-- 
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


</pre>
  </body>
</html>