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 253-259 a.add, a.delete { Link Here
253
                                  [% mapping.search_field_label | html %]
253
                                  [% mapping.search_field_label | html %]
254
                                </td>
254
                                </td>
255
                                <td>
255
                                <td>
256
                                  <input type="hidden" name="mapping_sort" value="[% mapping.sort | html %]" readonly />[% IF mapping.sort == 'undef' %]Undef[% ELSE %][% mapping.sort | html %][% END %]
256
                                  [% IF mapping.sort == 0 %]
257
                                      <input type="hidden" name="mapping_sort" value="0" readonly />No
258
                                  [% ELSE %]
259
                                      <input type="hidden" name="mapping_sort" value="1" readonly />Yes
260
                                  [% END %]
257
                                </td>
261
                                </td>
258
                                <td>
262
                                <td>
259
                                  <input type="hidden" name="mapping_facet" value="[% mapping.facet | html %]" readonly />[% IF mapping.facet == 1 %]Yes[% ELSE %]No[% END %]
263
                                  <input type="hidden" name="mapping_facet" value="[% mapping.facet | html %]" readonly />[% IF mapping.facet == 1 %]Yes[% ELSE %]No[% END %]
Lines 277-296 a.add, a.delete { Link Here
277
                                </td>
281
                                </td>
278
                                <td>
282
                                <td>
279
                                  <select name="mapping_sort">
283
                                  <select name="mapping_sort">
280
                                    [% IF mapping.sort == 'undef' %]
281
                                      <option value="undef" selected="selected">Undef</option>
282
                                    [% ELSE %]
283
                                      <option value="undef">Undef</option>
284
                                    [% END %]
285
                                    [% IF mapping.sort == 0 %]
284
                                    [% IF mapping.sort == 0 %]
286
                                      <option value="0" selected="selected">0</option>
285
                                      <option value="0" selected="selected">No</option>
287
                                    [% ELSE %]
286
                                      <option value="1">Yes</option>
288
                                      <option value="0">0</option>
289
                                    [% END %]
290
                                    [% IF  mapping.sort == 1 %]
291
                                      <option value="1" selected="selected">1</option>
292
                                    [% ELSE %]
287
                                    [% ELSE %]
293
                                      <option value="1">1</option>
288
                                      <option value="0">No</option>
289
                                      <option value="1" selected="selected">Yes</option>
294
                                    [% END %]
290
                                    [% END %]
295
                                  </select>
291
                                  </select>
296
                                </td>
292
                                </td>
297
- 

Return to bug 27316