Bugzilla – Attachment 189302 Details for
Bug 41151
Vue Additional Fields UX Improvements
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 41151: Revert multi-value display and export formatting changes
Bug-41151-Revert-multi-value-display-and-export-fo.patch (text/plain), 5.54 KB, created by
Martin Renvoize (ashimema)
on 2025-11-07 12:20:39 UTC
(
hide
)
Description:
Bug 41151: Revert multi-value display and export formatting changes
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2025-11-07 12:20:39 UTC
Size:
5.54 KB
patch
obsolete
>From 98a99b60f67da3b0a19e0168dc4e09bbf801f91e Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@openfifth.co.uk> >Date: Fri, 7 Nov 2025 12:14:12 +0000 >Subject: [PATCH] Bug 41151: Revert multi-value display and export formatting > changes > >This reverts commits: >- 042b0e90bab "Bug 41151: Preserve multi-value formatting in datatable exports" >- dc280faea41 "Bug 41151: Display multi-value additional fields as lists in datatables" > >These commits attempted to improve the display of multi-value additional >fields in datatables by rendering them as lists and preserving newlines >in exports. However, the implementation conflicted with existing >DataTables export button formatting that strips newlines for security >reasons (Bug 37727). > >The root issue is that Koha currently uses: >- datatables.net-buttons 2.3.4 (from Feb 2023) >- datatables.net-vue3 2.0.0 (requires DataTables 1.x) > >Native support for escapeExcelFormula (which would allow proper newline >handling) requires: >- datatables.net-buttons 3.2.0+ (introduced escapeExcelFormula) >- datatables.net-vue3 3.x (for DataTables 2.x compatibility) > >This revert allows us to: >1. Create a separate bug for upgrading DataTables to version 2.x with > Buttons 3.x for native formula escaping and better export handling >2. Re-implement the multi-value display feature with proper export > support once the DataTables upgrade is complete > >The reverted functionality will be restored in future patches once the >underlying DataTables infrastructure is upgraded. >--- > .../prog/js/vue/components/KohaTable.vue | 64 ++----------------- > 1 file changed, 7 insertions(+), 57 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/KohaTable.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/KohaTable.vue >index 56fa2d458bf..6ce067b8e46 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/KohaTable.vue >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/KohaTable.vue >@@ -115,49 +115,13 @@ export default { > searchable_field => { > var _customRender = (function (searchable_field) { > var _render = function (data, type, row, meta) { >- const fieldValues = >- row._strings.additional_field_values >- .filter( >- field => >- field.field_id == >- searchable_field.extended_attribute_type_id >- ) >- .map(el => el.value_str); >- >- if (fieldValues.length === 0) { >- return ""; >- } >- >- const valueStr = fieldValues[0]; >- >- // Check if there are multiple comma-separated values >- if (valueStr && valueStr.includes(",")) { >- const values = valueStr >- .split(",") >- .map(v => v.trim()) >- .filter(v => v); >- if (values.length > 1) { >- // For export, return newline-separated values >- // CSV/Excel export will properly quote cells containing newlines >- if (type === "export") { >- return values.join("\n"); >- } >- // For display, return as unordered list >- return ( >- '<ul class="additional-field-list">' + >- values >- .map( >- v => >- "<li>" + v + "</li>" >- ) >- .join("") + >- "</ul>" >- ); >- } >- } >- >- // Single value, return as-is >- return valueStr; >+ return row._strings.additional_field_values >+ .filter( >+ field => >+ field.field_id == >+ searchable_field.extended_attribute_type_id >+ ) >+ .map(el => el.value_str); > }; > return _render; > })(searchable_field); >@@ -377,17 +341,3 @@ export default { > }, > }; > </script> >- >-<style> >-/* Additional fields list styling in datatable */ >-.additional-field-list { >- margin: 0; >- padding-left: 1.2em; >- list-style-type: disc; >-} >- >-.additional-field-list li { >- padding: 0.1rem 0; >- line-height: 1.4; >-} >-</style> >-- >2.51.1
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 41151
:
188814
|
188815
|
188816
|
188817
|
188818
|
188819
|
188820
|
188821
|
188822
|
188874
|
188875
|
188876
|
188877
|
188878
|
188879
|
188880
|
188922
|
189295
|
189296
|
189297
|
189298
|
189299
|
189300
|
189301
| 189302