Bug 26632 - BatchStageMarcRecords passes a random number to AddBiblioToBatch / AddAuthToBatch
Summary: BatchStageMarcRecords passes a random number to AddBiblioToBatch / AddAuthToB...
Status: Signed Off
Alias: None
Product: Koha
Classification: Unclassified
Component: MARC Bibliographic record staging/import (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Nick Clemens
QA Contact: Testopia
URL:
Keywords:
Depends on: 22532
Blocks:
  Show dependency treegraph
 
Reported: 2020-10-08 12:51 UTC by Nick Clemens
Modified: 2022-08-05 12:41 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 26632: (Bug 22532 follow-up) Remove random variables (1.57 KB, patch)
2022-05-16 19:34 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 26632: Remove two more occurrences (1.57 KB, patch)
2022-05-16 19:38 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 26632: (Bug 22532 follow-up) Remove random variables (1.63 KB, patch)
2022-08-04 20:26 UTC, ByWater Sandboxes
Details | Diff | Splinter Review
Bug 26632: Remove two more occurrences (1.61 KB, patch)
2022-08-04 20:26 UTC, ByWater Sandboxes
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Clemens 2020-10-08 12:51:46 UTC
424                 $import_record_id = AddBiblioToBatch($batch_id, $rec_num, $marc_record, $encoding, int(rand(99999)), 0);
 430                 $import_record_id = AddAuthToBatch($batch_id, $rec_num, $marc_record, $encoding, int(rand(99999)), 0, $marc_type);

This populates:
my $update_counts = @_ ? shift : 1;

Which is used once:
_update_batch_record_counts($batch_id) if $update_counts;

So...almost always we want to update, but very occasionally, randomly, don't?
Comment 1 Jonathan Druart 2020-10-12 15:30:43 UTC
Looks like it's coming from

  commit 5867683fe9aa91d9284d3554cebff9bbec2fa117
  Bug 22532: Remove Z39.50 random

Those rand calls must be removed.
Comment 2 Nick Clemens 2022-05-16 19:34:28 UTC
Created attachment 135047 [details] [review]
Bug 26632: (Bug 22532 follow-up) Remove random variables

AddBiblioToBatch and AddAuthToBatch were btoh passing a random number for the
parameter $update_counts

This simply removes that value as should have been done on 22532

To test:
1 - Stage a marc file
2 - Confirm it works befor and after patch
Comment 3 Nick Clemens 2022-05-16 19:38:19 UTC
Created attachment 135048 [details] [review]
Bug 26632: Remove two more occurrences
Comment 4 ByWater Sandboxes 2022-08-04 20:26:49 UTC
Created attachment 138612 [details] [review]
Bug 26632: (Bug 22532 follow-up) Remove random variables

AddBiblioToBatch and AddAuthToBatch were btoh passing a random number for the
parameter $update_counts

This simply removes that value as should have been done on 22532

To test:
1 - Stage a marc file
2 - Confirm it works befor and after patch

Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>
Comment 5 ByWater Sandboxes 2022-08-04 20:26:52 UTC
Created attachment 138613 [details] [review]
Bug 26632: Remove two more occurrences

Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>
Comment 6 Katrin Fischer 2022-08-05 11:04:23 UTC
Please don't forget to set Assignee!