[Bug 21184] New: C4::Items - Remove GetBarcodeFromItemnumber

classic Classic list List threaded Threaded
19 messages Options
Reply | Threaded
Open this post in threaded view
|

[Bug 21184] New: C4::Items - Remove GetBarcodeFromItemnumber

bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21184

            Bug ID: 21184
           Summary: C4::Items - Remove GetBarcodeFromItemnumber
 Change sponsored?: ---
           Product: Koha
           Version: unspecified
          Hardware: All
                OS: All
            Status: ASSIGNED
          Severity: enhancement
          Priority: P5 - low
         Component: Architecture, internals, and plumbing
          Assignee: [hidden email]
          Reporter: [hidden email]
        QA Contact: [hidden email]

my $barcode = GetBarcodeFromItemnumber($itemnumber);

will become:

my $barcode = Koha::Items->find($itemnumber)->barcode;

--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 21184] C4::Items - Remove GetBarcodeFromItemnumber

bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21184

Jonathan Druart <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Blocks|                            |18252


Referenced Bugs:

https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18252
[Bug 18252] Move C4::Items code to the Koha namespace
--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 21184] C4::Items - Remove GetBarcodeFromItemnumber

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21184

Jonathan Druart <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Depends on|                            |21183


Referenced Bugs:

https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21183
[Bug 21183] C4::Items - Remove GetItemnumberFromBarcode
--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 21184] C4::Items - Remove GetBarcodeFromItemnumber

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21184

Jonathan Druart <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |Needs Signoff

--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 21184] C4::Items - Remove GetBarcodeFromItemnumber

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21184

--- Comment #1 from Jonathan Druart <[hidden email]> ---
Created attachment 77589
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=77589&action=edit
Bug 21184: Replace C4::Items::GetBarcodeFromItemnumber calls

Those calls to C4::Items::GetBarcodeFromItemnumber can be replaced with
    my $barcode = Koha::Items->find($itemnumber)->barcode;
But if we are not sure that the item exists, we should test the return
of ->find before ->barcode

Test plan:
- Edit an item
- Check an item in

- Test SIP - I do not really know how to trigger that code, apparently
misc/sip_cli_emulator.pl does not deal with holds. Any ideas?

--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 21184] C4::Items - Remove GetBarcodeFromItemnumber

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21184

--- Comment #2 from Jonathan Druart <[hidden email]> ---
Created attachment 77590
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=77590&action=edit
Bug 21184: Remove GetBarcodeFromItemnumber

Test plan:
  git grep GetBarcodeFromItemnumber
should not return anything

--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 21184] C4::Items - Remove GetBarcodeFromItemnumber

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21184

Jonathan Druart <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Blocks|                            |21201


Referenced Bugs:

https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21201
[Bug 21201] C4::Items - Remove GetItemnumbersForBiblio
--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 21184] C4::Items - Remove GetBarcodeFromItemnumber

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21184

Jonathan Druart <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Blocks|                            |21204


Referenced Bugs:

https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21204
[Bug 21204] Move C4::Acquisition code to the Koha namespace
--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 21184] C4::Items - Remove GetBarcodeFromItemnumber

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21184

Jonathan Druart <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Blocks|21204                       |


Referenced Bugs:

https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21204
[Bug 21204] Move C4::Acquisition code to the Koha namespace
--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 21184] C4::Items - Remove GetBarcodeFromItemnumber

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21184

Jonathan Druart <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Blocks|                            |21206


Referenced Bugs:

https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21206
[Bug 21206] C4::Items - Remove GetItem
--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 21184] C4::Items - Remove GetBarcodeFromItemnumber

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21184

--- Comment #3 from Josef Moravec <[hidden email]> ---
Comment on attachment 77589
  --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=77589
Bug 21184: Replace C4::Items::GetBarcodeFromItemnumber calls

Review of attachment 77589:
 --> (https://bugs.koha-community.org/bugzilla3/page.cgi?id=splinter.html&bug=21184&attachment=77589)
-----------------------------------------------------------------

::: C4/SIP/ILS/Patron.pm
@@ +316,5 @@
>      my $self = shift;
>      my $item_arr = $self->x_items('hold_items', @_);
>      foreach my $item (@{$item_arr}) {
> +        my $item = Koha::Items->find($item->{itemnumber});
> +        $item->{barcode} = $item ? $item->barcode : undef;

I think there is too many variables called $item ;)

--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 21184] C4::Items - Remove GetBarcodeFromItemnumber

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21184

Jonathan Druart <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #77589|0                           |1
        is obsolete|                            |
  Attachment #77590|0                           |1
        is obsolete|                            |

--- Comment #4 from Jonathan Druart <[hidden email]> ---
Created attachment 77955
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=77955&action=edit
Bug 21184: Replace C4::Items::GetBarcodeFromItemnumber calls

Those calls to C4::Items::GetBarcodeFromItemnumber can be replaced with
    my $barcode = Koha::Items->find($itemnumber)->barcode;
But if we are not sure that the item exists, we should test the return
of ->find before ->barcode

Test plan:
- Edit an item
- Check an item in

- Test SIP - I do not really know how to trigger that code, apparently
misc/sip_cli_emulator.pl does not deal with holds. Any ideas?

--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 21184] C4::Items - Remove GetBarcodeFromItemnumber

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21184

--- Comment #5 from Jonathan Druart <[hidden email]> ---
Created attachment 77956
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=77956&action=edit
Bug 21184: Remove GetBarcodeFromItemnumber

Test plan:
  git grep GetBarcodeFromItemnumber
should not return anything

--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 21184] C4::Items - Remove GetBarcodeFromItemnumber

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21184

--- Comment #6 from Jonathan Druart <[hidden email]> ---
(In reply to Josef Moravec from comment #3)
> Comment on attachment 77589 [details] [review]
> I think there is too many variables called $item ;)

Haha yes, good catch :)

--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 21184] C4::Items - Remove GetBarcodeFromItemnumber

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21184

Josef Moravec <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[hidden email]

--- Comment #7 from Josef Moravec <[hidden email]> ---
You could test this using something like this:

misc/sip_cli_emulator.pl -a localhost -p 6001 -su <login> -sp <passsword> -l
<library_code> --patron <borrowernumber> -s "Y         " -m patron_information

--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 21184] C4::Items - Remove GetBarcodeFromItemnumber

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21184

Josef Moravec <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|Needs Signoff               |Signed Off

--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 21184] C4::Items - Remove GetBarcodeFromItemnumber

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21184

Josef Moravec <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #77955|0                           |1
        is obsolete|                            |
  Attachment #77956|0                           |1
        is obsolete|                            |

--- Comment #8 from Josef Moravec <[hidden email]> ---
Created attachment 77961
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=77961&action=edit
Bug 21184: Replace C4::Items::GetBarcodeFromItemnumber calls

Those calls to C4::Items::GetBarcodeFromItemnumber can be replaced with
    my $barcode = Koha::Items->find($itemnumber)->barcode;
But if we are not sure that the item exists, we should test the return
of ->find before ->barcode

Test plan:
- Edit an item
- Check an item in

- Test SIP - I do not really know how to trigger that code, apparently
misc/sip_cli_emulator.pl does not deal with holds. Any ideas?

Signed-off-by: Josef Moravec <[hidden email]>

--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 21184] C4::Items - Remove GetBarcodeFromItemnumber

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21184

--- Comment #9 from Josef Moravec <[hidden email]> ---
Created attachment 77962
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=77962&action=edit
Bug 21184: Remove GetBarcodeFromItemnumber

Test plan:
  git grep GetBarcodeFromItemnumber
should not return anything

Signed-off-by: Josef Moravec <[hidden email]>

--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 21184] C4::Items - Remove GetBarcodeFromItemnumber

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21184

--- Comment #10 from Josef Moravec <[hidden email]> ---
Created attachment 77963
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=77963&action=edit
Bug 21184: (follow-up) Fix adding barcode to waiting hold item in SIP

Test plan:
1) Set up your SIP: https://wiki.koha-community.org/wiki/Koha_SIP2_server_setup
2) Run:
misc/sip_cli_emulator.pl -a localhost -p 6001 -su <login> -sp <passsword> -l
<library_code> --patron <borrowernumber> -s "Y         " -m patron_information

the -s parameter says what kind of additional information you want to see

3) Check the response: if the requested patron has waiting hold, there
is field "AS" with the barcode of waiting item

The right response looks like this:
64              00120180817
052434000100000000000000000000AOCPL|AA1|AEKoha
Admin|BLY|CC5|AS39999000004410|PCS|PIY|AFGreetings from Koha. |

More reading ;)
http://multimedia.3m.com/mws/media/355361O/sip2-protocol.pdf

Signed-off-by: Josef Moravec <[hidden email]>

--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/