Skip to content

Commit 2cc6d00

Browse files
Fix the author searching if there is no first name and change the hint text
1 parent c2f0f79 commit 2cc6d00

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

DocDB/cgi/AuthorHTML.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ sub AuthorActiveSearch {
344344
$HTML .= '<ul id="authors_id_span"></ul>'."\n";
345345
$HTML .= '</div>'."\n";
346346
$HTML .= '<input id="author_dummy" class="hidden required" type="checkbox" value="dummy" name="authors" />'."\n";
347-
$HTML .= '<input name="authors_selection_text" type="text" id="authors_selector"><br /> (click or press <i>Enter</i>)'."\n";
347+
$HTML .= '<input name="authors_selection_text" type="text" id="authors_selector"><br /> (type to search and<br/>click or press <i>Enter</i>)'."\n";
348348

349349
$HTML .= '<script type="text/javascript">
350350
<!--

DocDB/html/js/AuthorSearch.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ jQuery().ready(function() {
7070
};
7171

7272
function matchSubset_starts(s, sub) {
73+
if (s === undefined || s === null)
74+
return false;
7375
if (!options.matchCase)
7476
s = s.toLowerCase();
7577
var i = s.indexOf(sub);
@@ -178,6 +180,8 @@ jQuery().ready(function() {
178180

179181
/* Match second name with highest priority, first name with lower, and other with lowest */
180182
function parse_first_last_names(s){
183+
if (s.indexOf(",") == -1)
184+
return {first:"", last:s};
181185
first = s.split(",")[1];
182186
last = s.split(",")[0];
183187
/* TODO: is always comma available ? */

0 commit comments

Comments
 (0)