View | Details | Raw Unified | Return to bug 27316
Collapse All | Expand All

(-)a/installer/data/mysql/atomicupdate/bug_23716_update_sort_mappings.perl (+6 lines)
Line 0 Link Here
1
$DBversion = 'XXX';
2
if( CheckVersion( $DBversion ) ) {
3
    $dbh->do( "UPDATE search_marc_to_field SET sort = 1 WHERE sort IS NULL" );
4
    $dbh->do( "ALTER TABLE search_marc_to_field MODIFY COLUMN sort tinyint(1) DEFAULT 1 NOT NULL COMMENT 'Sort defaults to 1 (Yes) and creates sort fields in the index, 0 (no) will prevent this'" );
5
    NewVersion( $DBversion, 27316, "In Elastisearch mappings convert NULL (Undef) for sort to 1 (Yes)");
6
}
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/searchengine/elasticsearch/mappings.tt (-14 / +9 lines)
Lines 310-316 a.add, a.delete { Link Here
310
                                  [% mapping.search_field_label | html %]
310
                                  [% mapping.search_field_label | html %]
311
                                </td>
311
                                </td>
312
                                <td>
312
                                <td>
313
                                  <input type="hidden" name="mapping_sort" value="[% mapping.sort | html %]" readonly />[% IF mapping.sort == 'undef' %]Undef[% ELSE %][% mapping.sort | html %][% END %]
313
                                  [% IF mapping.sort == 0 %]
314
                                      <input type="hidden" name="mapping_sort" value="0" readonly />No
315
                                  [% ELSE %]
316
                                      <input type="hidden" name="mapping_sort" value="1" readonly />Yes
317
                                  [% END %]
314
                                </td>
318
                                </td>
315
                                <td>
319
                                <td>
316
                                  <input type="hidden" name="mapping_facet" value="[% mapping.facet | html %]" readonly />[% IF mapping.facet == 1 %]Yes[% ELSE %]No[% END %]
320
                                  <input type="hidden" name="mapping_facet" value="[% mapping.facet | html %]" readonly />[% IF mapping.facet == 1 %]Yes[% ELSE %]No[% END %]
Lines 334-353 a.add, a.delete { Link Here
334
                                </td>
338
                                </td>
335
                                <td>
339
                                <td>
336
                                  <select name="mapping_sort">
340
                                  <select name="mapping_sort">
337
                                    [% IF mapping.sort == 'undef' %]
338
                                      <option value="undef" selected="selected">Undef</option>
339
                                    [% ELSE %]
340
                                      <option value="undef">Undef</option>
341
                                    [% END %]
342
                                    [% IF mapping.sort == 0 %]
341
                                    [% IF mapping.sort == 0 %]
343
                                      <option value="0" selected="selected">0</option>
342
                                      <option value="0" selected="selected">No</option>
344
                                    [% ELSE %]
343
                                      <option value="1">Yes</option>
345
                                      <option value="0">0</option>
346
                                    [% END %]
347
                                    [% IF  mapping.sort == 1 %]
348
                                      <option value="1" selected="selected">1</option>
349
                                    [% ELSE %]
344
                                    [% ELSE %]
350
                                      <option value="1">1</option>
345
                                      <option value="0">No</option>
346
                                      <option value="1" selected="selected">Yes</option>
351
                                    [% END %]
347
                                    [% END %]
352
                                  </select>
348
                                  </select>
353
                                </td>
349
                                </td>
354
- 

Return to bug 27316