Bug 21183 - C4::Items - Remove GetItemnumberFromBarcode
Summary: C4::Items - Remove GetItemnumberFromBarcode
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Keywords:
Depends on: 21182
Blocks: 18252 21184 22288
  Show dependency treegraph
 
Reported: 2018-08-08 18:11 UTC by Jonathan Druart
Modified: 2020-01-06 20:15 UTC (History)
3 users (show)

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


Attachments
Bug 21183: Replace C4::Items::GetItemnumberFromBarcode calls (10.23 KB, patch)
2018-08-08 18:26 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 21183: Remove GetItemnumberFromBarcode (1.21 KB, patch)
2018-08-08 18:26 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 21183: Replace C4::Items::GetItemnumberFromBarcode calls (10.29 KB, patch)
2018-08-10 15:04 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 21183: Replace C4::Items::GetItemnumberFromBarcode calls (10.24 KB, patch)
2018-08-16 14:35 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 21183: Fix ->get_column call context (990 bytes, patch)
2018-08-16 15:12 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 21183: Remove GetItemnumberFromBarcode (1.26 KB, patch)
2018-08-16 15:50 UTC, Josef Moravec
Details | Diff | Splinter Review
Bug 21183: Replace C4::Items::GetItemnumberFromBarcode calls (10.24 KB, patch)
2018-08-16 15:50 UTC, Josef Moravec
Details | Diff | Splinter Review
Bug 21183: Fix ->get_column call context (1.01 KB, patch)
2018-08-16 15:50 UTC, Josef Moravec
Details | Diff | Splinter Review
Bug 21183: Remove GetItemnumberFromBarcode (1.32 KB, patch)
2018-08-21 21:59 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 21183: Replace C4::Items::GetItemnumberFromBarcode calls (10.30 KB, patch)
2018-08-21 21:59 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 21183: Fix ->get_column call context (1.07 KB, patch)
2018-08-21 21:59 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Druart 2018-08-08 18:11:09 UTC
C4::Items::GetItemnumberFromBarcode calls can be replaced with
  Koha::Items->find({ barcode => $barcode });
Comment 1 Jonathan Druart 2018-08-08 18:26:53 UTC
Created attachment 77586 [details] [review]
Bug 21183: Replace C4::Items::GetItemnumberFromBarcode calls

C4::Items::GetItemnumberFromBarcode calls can be replaced with
  Koha::Items->find({ barcode => $barcode });

We should make sure the barcode existed in DB and so that ->find
returns an object. Note that most of the time we just wanted to know if
the barcode existed.
The changes are very simple, the only one that need attention is
the one in batchMod.pl. It is basically reusing what we did on
bug 21141.

Test plan:
Use the batch item modification/deletion tools to modify/delete items
from their barcode (using the textarea or a file)
Comment 2 Jonathan Druart 2018-08-08 18:26:57 UTC
Created attachment 77587 [details] [review]
Bug 21183: Remove GetItemnumberFromBarcode

Test plan:
  git grep GetItemnumberFromBarcode
should not return anything
Comment 3 Jonathan Druart 2018-08-10 15:04:11 UTC
Created attachment 77687 [details] [review]
Bug 21183: Replace C4::Items::GetItemnumberFromBarcode calls

C4::Items::GetItemnumberFromBarcode calls can be replaced with
  Koha::Items->find({ barcode => $barcode });

We should make sure the barcode existed in DB and so that ->find
returns an object. Note that most of the time we just wanted to know if
the barcode existed.
The changes are very simple, the only one that need attention is
the one in batchMod.pl. It is basically reusing what we did on
bug 21141.

Test plan:
Use the batch item modification/deletion tools to modify/delete items
from their barcode (using the textarea or a file)
Comment 4 Josef Moravec 2018-08-16 10:57:49 UTC
After submitting some barcodes in tools -> item batch modification:

Can't locate object method "get_column" via package "0" (perhaps you forgot to load "0"?) at /home/vagrant/kohaclone/tools/batchMod.pl line 268.
Comment 5 Jonathan Druart 2018-08-16 14:35:27 UTC
Created attachment 77930 [details] [review]
Bug 21183: Replace C4::Items::GetItemnumberFromBarcode calls

C4::Items::GetItemnumberFromBarcode calls can be replaced with
  Koha::Items->find({ barcode => $barcode });

We should make sure the barcode existed in DB and so that ->find
returns an object. Note that most of the time we just wanted to know if
the barcode existed.
The changes are very simple, the only one that need attention is
the one in batchMod.pl. It is basically reusing what we did on
bug 21141.

Test plan:
Use the batch item modification/deletion tools to modify/delete items
from their barcode (using the textarea or a file)
Comment 6 Josef Moravec 2018-08-16 15:01:14 UTC
Sorry, but still not working:

Can't use string ("2") as an ARRAY ref while "strict refs" in use at /home/vagrant/kohaclone/tools/batchMod.pl line 269
Comment 7 Jonathan Druart 2018-08-16 15:12:42 UTC
Created attachment 77933 [details] [review]
Bug 21183: Fix ->get_column call context

I am not sure to understand what's going on here.
Comment 8 Jonathan Druart 2018-08-16 15:13:12 UTC
Hum, weird...
Comment 9 Josef Moravec 2018-08-16 15:50:10 UTC
Created attachment 77936 [details] [review]
Bug 21183: Remove GetItemnumberFromBarcode

Test plan:
  git grep GetItemnumberFromBarcode
should not return anything

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 10 Josef Moravec 2018-08-16 15:50:14 UTC
Created attachment 77937 [details] [review]
Bug 21183: Replace C4::Items::GetItemnumberFromBarcode calls

C4::Items::GetItemnumberFromBarcode calls can be replaced with
  Koha::Items->find({ barcode => $barcode });

We should make sure the barcode existed in DB and so that ->find
returns an object. Note that most of the time we just wanted to know if
the barcode existed.
The changes are very simple, the only one that need attention is
the one in batchMod.pl. It is basically reusing what we did on
bug 21141.

Test plan:
Use the batch item modification/deletion tools to modify/delete items
from their barcode (using the textarea or a file)

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 11 Josef Moravec 2018-08-16 15:50:18 UTC
Created attachment 77938 [details] [review]
Bug 21183: Fix ->get_column call context

I am not sure to understand what's going on here.

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 12 Katrin Fischer 2018-08-21 21:59:16 UTC
Created attachment 78056 [details] [review]
Bug 21183: Remove GetItemnumberFromBarcode

Test plan:
  git grep GetItemnumberFromBarcode
should not return anything

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 13 Katrin Fischer 2018-08-21 21:59:20 UTC
Created attachment 78057 [details] [review]
Bug 21183: Replace C4::Items::GetItemnumberFromBarcode calls

C4::Items::GetItemnumberFromBarcode calls can be replaced with
  Koha::Items->find({ barcode => $barcode });

We should make sure the barcode existed in DB and so that ->find
returns an object. Note that most of the time we just wanted to know if
the barcode existed.
The changes are very simple, the only one that need attention is
the one in batchMod.pl. It is basically reusing what we did on
bug 21141.

Test plan:
Use the batch item modification/deletion tools to modify/delete items
from their barcode (using the textarea or a file)

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 14 Katrin Fischer 2018-08-21 21:59:24 UTC
Created attachment 78058 [details] [review]
Bug 21183: Fix ->get_column call context

I am not sure to understand what's going on here.

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 15 Nick Clemens 2018-08-30 14:12:02 UTC
Awesome work all!

Pushed to master for 18.11
Comment 16 Martin Renvoize 2018-09-05 10:27:05 UTC
Refactoring enhancement, will not be backported to 18.05.x series.