Bug 31748

Summary: Restore progress bar on record import
Product: Koha Reporter: Tomás Cohen Arazi (tcohen) <tomascohen>
Component: ToolsAssignee: Kyle M Hall (khall) <kyle>
Status: Failed QA --- QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: andrew, dcook, lisette, lucas, rcoert, tomascohen
Version: unspecified   
Hardware: All   
OS: All   
GIT URL: Change sponsored?: ---
Patch complexity: --- Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
Circulation function:
Bug Depends on: 31666    
Bug Blocks: 31892    
Attachments: Bug 31748: Restore progress bar on record import

Description Tomás Cohen Arazi (tcohen) 2022-10-12 19:50:31 UTC
We've got the progress bar for staging back, we now want it for managing staged records.
Comment 1 Katrin Fischer 2022-11-14 23:10:34 UTC
Yes please!
Comment 2 Kyle M Hall (khall) 2022-11-18 14:50:30 UTC
Created attachment 144068 [details] [review]
Bug 31748: Restore progress bar on record import

Test Plan:
1) Apply this patch
2) Upload a marc batch
3) Import the marc batch
4) Note that under the message "The job has been enqueued! It will be processed as soon as possible."
   There is now a functioning progress bar and the page no longer redirects automatically.
Comment 3 Andrew Fuerste-Henry 2022-12-27 19:46:33 UTC
With this patch I *do* get a progress bar, but it never progresses from 0%. It just sits there until I get bored and reload the page, at which point Koha shows that the batch has imported.
Comment 4 Tomás Cohen Arazi (tcohen) 2022-12-27 19:52:18 UTC
(In reply to Andrew Fuerste-Henry from comment #3)
> With this patch I *do* get a progress bar, but it never progresses from 0%.
> It just sits there until I get bored and reload the page, at which point
> Koha shows that the batch has imported.

That's related to the fact Koha doesn't know how many records it needs to process until it processes the MARC file. I guess we could add a pre-flight, to gather those counters, and it would be a win even if it adds one or two extra seconds to the process.