Bugzilla – Attachment 193153 Details for
Bug 38122
Cannot sort holdings table by status
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 38122: Fix server error when handling malformed request parameters
Bug-38122-Fix-server-error-when-handling-malformed.patch (text/plain), 4.01 KB, created by
Ayoub Glizi-Vicioso
on 2026-02-13 20:26:24 UTC
(
hide
)
Description:
Bug 38122: Fix server error when handling malformed request parameters
Filename:
MIME Type:
Creator:
Ayoub Glizi-Vicioso
Created:
2026-02-13 20:26:24 UTC
Size:
4.01 KB
patch
obsolete
>From 3a2e0f1ef874a58b848638276927d456678d55ee Mon Sep 17 00:00:00 2001 >From: Ayoub Glizi-Vicioso <ayoub.glizi-vicioso@inLibro.com> >Date: Fri, 13 Feb 2026 15:24:56 -0500 >Subject: [PATCH] Bug 38122: Fix server error when handling malformed request > parameters > >--- > Koha/REST/V1/Biblios.pm | 4 ++-- > api/v1/swagger/paths/biblios.yaml | 6 +----- > api/v1/swagger/swagger.yaml | 6 ++++++ > .../includes/html_helpers/tables/items/catalogue_detail.inc | 4 ++++ > 4 files changed, 13 insertions(+), 7 deletions(-) > >diff --git a/Koha/REST/V1/Biblios.pm b/Koha/REST/V1/Biblios.pm >index 89d0629cdd..4ffca7dbfb 100644 >--- a/Koha/REST/V1/Biblios.pm >+++ b/Koha/REST/V1/Biblios.pm >@@ -255,7 +255,7 @@ sub get_items { > # Deletion of parameter to avoid filtering on the items table in the case of bookings on 'itemtype' > $c->req->params->remove('bookable'); > >- my $group_by_status = $c->param('group_by_status'); >+ my $group_by_status = $c->param('group_by_status') ? 1 : 0; > $c->req->params->remove('group_by_status'); > > return $c->render_resource_not_found("Bibliographic record") >@@ -274,7 +274,7 @@ sub get_items { > $items_rs = $items_rs->search( > {}, > { >- order_by => [ >+ order_by => [ > \[ "CASE > WHEN (withdrawn != 0) THEN '10_Withdrawn' > WHEN (itemlost != 0) THEN '09_Lost' >diff --git a/api/v1/swagger/paths/biblios.yaml b/api/v1/swagger/paths/biblios.yaml >index 74e79fac64..81129e5c64 100644 >--- a/api/v1/swagger/paths/biblios.yaml >+++ b/api/v1/swagger/paths/biblios.yaml >@@ -494,16 +494,12 @@ > - $ref: "../swagger.yaml#/parameters/q_param" > - $ref: "../swagger.yaml#/parameters/q_body" > - $ref: "../swagger.yaml#/parameters/request_id_header" >+ - $ref: "../swagger.yaml#/parameters/group_by_status" > - name: bookable > in: query > description: Limit to items that are bookable > required: false > type: boolean >- - name: group_by_status >- in: query >- description: Return the items grouped by status >- required: false >- type: boolean > consumes: > - application/json > produces: >diff --git a/api/v1/swagger/swagger.yaml b/api/v1/swagger/swagger.yaml >index 9a9b7af756..78206d137c 100644 >--- a/api/v1/swagger/swagger.yaml >+++ b/api/v1/swagger/swagger.yaml >@@ -933,6 +933,12 @@ parameters: > name: _per_page > required: false > type: integer >+ group_by_status: >+ name: group_by_status >+ in: query >+ description: "Return the items grouped by status" >+ required: false >+ type: boolean > preservation_processing_id_pp: > description: processing internal identifier > in: path >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc >index 908165866a..00c480c023 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc >@@ -381,6 +381,7 @@ > }; > > if (is_grouping) { >+ dt_options["ordering"]= false; > dt_options["rowGroup"] = { > "dataSrc": function(row) { > return get_display_status(row, true); >@@ -633,6 +634,9 @@ > searchable: false, > orderable: false, > render: function (data, type, row, meta) { >+ if (type === 'sort' || type === 'filter' || type === 'type') { >+ return get_display_status(row, true); >+ } > let nodes = ""; > row._status.forEach( status => { > if ( status == 'checked_out' || status == 'local_use') { >-- >2.52.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 38122
:
183789
|
184550
|
187227
|
187410
|
191419
|
191420
|
191421
|
191423
|
191424
|
191425
|
191426
|
191529
|
191530
|
191531
|
191532
|
192992
|
192993
|
192994
|
192995
|
193149
|
193150
|
193151
|
193152
| 193153