Bugzilla – Attachment 178406 Details for
Bug 27859
MARC export for search results
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 27859: (follow up) Fix background job error and js progress callback
Bug-27859-follow-up-Fix-background-job-error-and-j.patch (text/plain), 2.63 KB, created by
David Gustafsson
on 2025-02-20 12:57:24 UTC
(
hide
)
Description:
Bug 27859: (follow up) Fix background job error and js progress callback
Filename:
MIME Type:
Creator:
David Gustafsson
Created:
2025-02-20 12:57:24 UTC
Size:
2.63 KB
patch
obsolete
>From 5d82f33f976d09feda08ca0c9169476d3a63721a Mon Sep 17 00:00:00 2001 >From: David Gustafsson <david.gustafsson@ub.gu.se> >Date: Thu, 20 Feb 2025 12:36:16 +0100 >Subject: [PATCH] Bug 27859: (follow up) Fix background job error and js > progress callback > >--- > Koha/BackgroundJob/SearchResultExport.pm | 5 +++-- > koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt | 5 +++-- > 2 files changed, 6 insertions(+), 4 deletions(-) > >diff --git a/Koha/BackgroundJob/SearchResultExport.pm b/Koha/BackgroundJob/SearchResultExport.pm >index 8c7da62d7b8..6ecf08fc3d6 100644 >--- a/Koha/BackgroundJob/SearchResultExport.pm >+++ b/Koha/BackgroundJob/SearchResultExport.pm >@@ -113,6 +113,7 @@ sub process { > my $upload_dir = Koha::UploadedFile->permanent_directory; > > while (my ($format, $data) = each %{$encoded_results}) { >+ $data = encode('UTF-8', $data); > my $hash = md5_hex($data); > my $category = "search_marc_export"; > my $time = strftime "%Y%m%d_%H%M", localtime time; >@@ -131,7 +132,7 @@ sub process { > > if ($fh) { > $fh->binmode; >- print $fh encode('UTF-8', $data); >+ print $fh $data; > $fh->close; > > my $size = -s $filepath; >@@ -159,7 +160,7 @@ sub process { > errors => \@errors, > query_string => $query_string, > }; >- $data->{report} = $report; >+ $data->{report} = $report; > if (@errors) { > $self->set({ progress => 0, status => 'failed' })->store; > } >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt >index 37e40dc6ed5..ed242b6fca8 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt >@@ -951,7 +951,7 @@ > [% Asset.js("js/job_progress.js") | $raw %] > <script> > [% IF export_job_id %] >- updateProgress([% export_job_id | html %], function() { >+ var job_finish_callback = function() { > $.getJSON('/api/v1/jobs/[% export_job_id | html %]', function(job) { > if (job.data.report.errors.length) { > humanMsg.displayMsg( >@@ -972,7 +972,8 @@ > .appendTo("#job_callback"); > } > }); >- }); >+ }; >+ updateProgress([% export_job_id | html %], { finish_callback: job_finish_callback }); > [% END %] > > var PREF_AmazonCoverImages = parseInt( "[% Koha.Preference('AmazonCoverImages') | html %]", 10); >-- >2.48.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 27859
:
117718
|
117721
|
124892
|
124893
|
128632
|
131442
|
131443
|
132993
|
132997
|
133076
|
145243
|
145244
|
145263
|
145300
|
147927
|
147935
|
147936
|
162342
|
162343
|
163761
|
163762
|
178145
|
178146
|
178370
|
178371
|
178376
|
178377
|
178399
|
178400
|
178401
|
178402
| 178406 |
178407
|
178408