Fixed entity type filter bug in new search system

This commit is contained in:
Dan Brown 2017-04-09 21:12:13 +01:00
parent 1338ae2fc3
commit 46f3d78c8a
No known key found for this signature in database
GPG key ID: 46D9F943C24A2EF9
3 changed files with 8 additions and 8 deletions

View file

@ -175,7 +175,7 @@ class SearchService
// Split filter values out
$splitFilters = [];
foreach ($terms['filters'] as $filter) {
$explodedFilter = explode(':', $filter, 1);
$explodedFilter = explode(':', $filter, 2);
$splitFilters[$explodedFilter[0]] = (count($explodedFilter) > 1) ? $explodedFilter[1] : '';
}
$terms['filters'] = $splitFilters;

View file

@ -53,6 +53,10 @@ let methods = {
return;
}
this.appendTerm(typeTerm);
},
updateSearch() {
window.location = '/search?term=' + encodeURIComponent(this.termString);
}
};

View file

@ -40,6 +40,9 @@
<label><input type="checkbox" v-on:change="typeChange" v-model="search.type.book" value="book"> Book</label>
</div>
<button type="button" class="button pos" v-on:click="updateSearch">Update Search</button>
</div>
</div>
@ -48,11 +51,4 @@
</div>
</div>
@stop
@section('scripts')
<script>
</script>
@stop