Bugzilla – Attachment 170764 Details for
Bug 37675
MARC basic editor loses data for records with thousands of the same field
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 37675: Make random generates the same numbers less probable
Bug-37675-Make-random-generates-the-same-numbers-l.patch (text/plain), 1.57 KB, created by
Jonathan Druart
on 2024-08-27 11:14:31 UTC
(
hide
)
Description:
Bug 37675: Make random generates the same numbers less probable
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2024-08-27 11:14:31 UTC
Size:
1.57 KB
patch
obsolete
>From ce36c6e56a4d11c449bf278127753eb424df0649 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 27 Aug 2024 13:10:53 +0200 >Subject: [PATCH] Bug 37675: Make random generates the same numbers less > probable > >This is really not the ideal patch but definitely the easiest to write >and with (hopefully) the least side-effects possible. > >Ideally we would like to rethink how this "id" is generated and start >from ... 1 > >To improve this patch we could follow-up and store the list of the >generate numbers, then generate a new one if it exists already. >--- > cataloguing/addbiblio.pl | 2 +- > koha-tmpl/intranet-tmpl/prog/js/cataloging.js | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > >diff --git a/cataloguing/addbiblio.pl b/cataloguing/addbiblio.pl >index 9d41a15a645..1b973b660e0 100755 >--- a/cataloguing/addbiblio.pl >+++ b/cataloguing/addbiblio.pl >@@ -183,7 +183,7 @@ sub MARCfindbreeding { > =cut > > sub CreateKey { >- return int(rand(1000000)); >+ return int(rand(10000000)); > } > > =head2 GetMandatoryFieldZ3950 >diff --git a/koha-tmpl/intranet-tmpl/prog/js/cataloging.js b/koha-tmpl/intranet-tmpl/prog/js/cataloging.js >index 2cb734ef6e1..ed0ac18b794 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/cataloging.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/cataloging.js >@@ -506,7 +506,7 @@ function UnCloneField(index) { > * This function create a random number > */ > function CreateKey(){ >- return parseInt(Math.random() * 100000); >+ return parseInt(Math.random() * 10000000); > } > > /* Functions developed for additem.tt */ >-- >2.34.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 37675
:
170470
|
170580
| 170764 |
170795
|
170796
|
170800