Bugzilla – Attachment 188877 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: Preserve multi-value formatting in datatable exports
Bug-41151-Preserve-multi-value-formatting-in-datat.patch (text/plain), 2.51 KB, created by
Martin Renvoize (ashimema)
on 2025-11-01 14:12:38 UTC
(
hide
)
Description:
Bug 41151: Preserve multi-value formatting in datatable exports
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2025-11-01 14:12:38 UTC
Size:
2.51 KB
patch
obsolete
>From 30171f3df6381ec1a4120ff8739641f60758ef02 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@openfifth.co.uk> >Date: Sat, 1 Nov 2025 14:11:31 +0000 >Subject: [PATCH] Bug 41151: Preserve multi-value formatting in datatable > exports > >This patch fixes the export functionality for repeatable additional >fields in datatables. Previously, when exporting to CSV or Excel, >multi-value fields displayed as HTML markup instead of properly >formatted values. > >The fix detects when DataTables is requesting data for export >(type === "export") and returns newline-separated values instead of >HTML list markup. This ensures that: > >- CSV exports properly quote cells containing newlines >- Excel exports display each value on a separate line within the cell >- The visual list structure is maintained in exported data >- Each field's values remain in the correct cell/row > >For example, a field with values "Bang, History" now exports as: > Bang > History > >(with each value on its own line within the same cell) > >This complements the display improvements made in the previous commits >while ensuring exports remain clean and properly formatted. >--- > .../intranet-tmpl/prog/js/vue/components/KohaTable.vue | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) > >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 0bade1bd343..56fa2d458bf 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/KohaTable.vue >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/KohaTable.vue >@@ -137,7 +137,12 @@ export default { > .map(v => v.trim()) > .filter(v => v); > if (values.length > 1) { >- // Return as unordered list >+ // 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 >-- >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