linked-swissbib / vufind

A library resource discovery portal designed and developed for libraries by libraries
GNU General Public License v2.0
1 stars 2 forks source link

Autocomplete not working in 2nd tab #20

Closed ltog closed 7 years ago

ltog commented 7 years ago

Typing lil in tab Bücher und Co. shows autocomplete suggestions, whereas typing the same in tab AutorInnen doesn't.

Hypothesis: The necessary JavaScript library typeahead.bundle.custom.js is not included. FALSE

Hypothesis: The class/id of the form changes on the second tab, so typing is not detected. TRUE

Tab1:

    <input type="text" value="" name="lookfor" id="searchForm_lookfor" class="form-control search-query twitterautocomplete searcher:Elasticsearch tt-input" autocomplete="off" spellcheck="false" style="position: relative; vertical-align: top; background-color: transparent;" dir="auto">

Tab2:

<input type="text" value="" name="lookfor" id="searchForm_lookfor" class="form-control search-query">

In ./themes/linkedswissbib/templates/search/searchbox.phtml:

<input class="form-control search-query<? if($this->searchbox()->autocompleteEnabled($this->searchClassId)):?> twitterautocomplete searcher:Elasticsearch<? endif ?>" id="searchForm_lookfor" type="text" name="lookfor" value="<?=$this->escapeHtmlAttr($this->lookfor)?>"/>

Aufruf führt zu ./module/VuFind/src/VuFind/View/Helper/Root/SearchBox.php:82: public function autocompleteEnabled($activeSearchClass)

Tab1: $activeSearchClass == "Solr" Tab2: $activeSearchClass == "Elasticsearch"