Bug 14369 - Only show 'Create labels' link on staged records import when status is 'Imported'
Summary: Only show 'Create labels' link on staged records import when status is 'Impor...
Status: Pushed to stable
Alias: None
Product: Koha
Classification: Unclassified
Component: Label/patron card printing (show other bugs)
Version: master
Hardware: All All
: P5 - low minor (vote)
Assignee: Katrin Fischer
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-06-09 18:42 UTC by Nicole C. Engard
Modified: 2020-05-14 18:01 UTC (History)
7 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:
20.05.00, 19.11.06


Attachments
error (24.75 KB, image/png)
2015-06-09 18:42 UTC, Nicole C. Engard
Details
Bug 14369: Only show 'Create labels' link on staged records import when status is imported (4.79 KB, patch)
2020-04-18 14:44 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 14369: Only show 'Create labels' link on staged records import when status is imported (4.84 KB, patch)
2020-04-19 20:09 UTC, David Nind
Details | Diff | Splinter Review
Bug 14369: Only show 'Create labels' link on staged records import when status is imported (4.90 KB, patch)
2020-04-20 13:05 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 14369: Only show 'Create labels' link on staged records import when status is imported (4.93 KB, patch)
2020-04-20 16:42 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 Nicole C. Engard 2015-06-09 18:42:48 UTC
Created attachment 40040 [details]
error

If you click the create label batch from manage-marc-import.pl on a file that's staged and not imported you get an error asking you to talk to the sys admin. The problem is simple - it's a staged file - not imported. I think that the option to create a label batch shouldn't show in this case.
Comment 1 Aleisha Amohia 2015-06-10 02:57:57 UTC
I can't recreate this bug on Koha 3.19.00.026 - There is no create a label batch option for staged files here.
Comment 2 j.kylmala 2015-08-20 12:58:48 UTC
I can reproduce this bug with non-unicode marc8 files. With unicode utf-8 MARC files there is no problem.
Comment 3 j.kylmala 2015-08-20 13:31:41 UTC
(In reply to Joonas Kylmälä from comment #2)
> I can reproduce this bug with non-unicode marc8 files. With unicode utf-8
> MARC files there is no problem.

I was a bit confused about how to import the MARC files there and which type of a MARC file, but I guess the one I should have imported there was MARC (Unicode/UTF-8) type of file. With that type of file the bug exists also, as I tried just a moment ago. I'll try to look into what might cause the bug here.
Comment 4 j.kylmala 2015-08-20 13:33:32 UTC
(In reply to Nicole C. Engard from comment #0)
> If you click the create label batch from manage-marc-import.pl on a file
> that's staged and not imported you get an error asking you to talk to the
> sys admin. The problem is simple - it's a staged file - not imported. I
> think that the option to create a label batch shouldn't show in this case.

Nicole, why the label batch shouldn't show in that case?

Also, which type of file we should stage with the stage-marc-import.pl page? If any type of MARC file then we need to fix this bug certainly but if there is one and the right file type which doesn't cause this bug then we should maybe restrict stage-marc-import.pl to only accept MARC files with that encoding.
Comment 5 Katrin Fischer 2019-02-10 21:18:36 UTC
(In reply to j.kylmala from comment #4)
> (In reply to Nicole C. Engard from comment #0)
> > If you click the create label batch from manage-marc-import.pl on a file
> > that's staged and not imported you get an error asking you to talk to the
> > sys admin. The problem is simple - it's a staged file - not imported. I
> > think that the option to create a label batch shouldn't show in this case.
> 
> Nicole, why the label batch shouldn't show in that case?

I think the reasoning is that the label creator won't work for records that are not part of the catalog yet (data in the right tables)
Comment 6 Katrin Fischer 2020-04-18 14:44:48 UTC
Created attachment 103204 [details] [review]
Bug 14369: Only show 'Create labels' link on staged records import when status is imported

The label creator won't be able to add a batch for items, if they are
not imported into the database (missing itemnumber). This patch hides
the link, when the status is not imported to avoid the error situation.

To test:
- Export a record with items from your Koha installation
- Delete record an items
- Stage the record with the items - the "Create labels" link should be showing
- Try to create the labels - note error
- Apply patch
- Retry - the link should no longer show
- Import the records - the should show now
- Crate labels again - a new batch should have been created
- Verify the link on the batch # leads to the batch in the labels module

Bonus: Moves the message from the .pl file to the template to make
it translatable.
Comment 7 David Nind 2020-04-19 20:09:44 UTC
Created attachment 103225 [details] [review]
Bug 14369: Only show 'Create labels' link on staged records import when status is imported

The label creator won't be able to add a batch for items, if they are
not imported into the database (missing itemnumber). This patch hides
the link, when the status is not imported to avoid the error situation.

To test:
- Export a record with items from your Koha installation
- Delete record and items
- Stage the record with the items - the "Create labels" link should be showing
- Try to create the labels - note error
- Apply patch
- Retry - the link should no longer show
- Import the records - the should show now
- Crate labels again - a new batch should have been created
- Verify the link on the batch # leads to the batch in the labels module

Bonus: Moves the message from the .pl file to the template to make
it translatable.

Signed-off-by: David Nind <david@davidnind.com>
Comment 8 Jonathan Druart 2020-04-20 13:05:02 UTC
Created attachment 103293 [details] [review]
Bug 14369: Only show 'Create labels' link on staged records import when status is imported

The label creator won't be able to add a batch for items, if they are
not imported into the database (missing itemnumber). This patch hides
the link, when the status is not imported to avoid the error situation.

To test:
- Export a record with items from your Koha installation
- Delete record an items
- Stage the record with the items - the "Create labels" link should be showing
- Try to create the labels - note error
- Apply patch
- Retry - the link should no longer show
- Import the records - the should show now
- Crate labels again - a new batch should have been created
- Verify the link on the batch # leads to the batch in the labels module

Bonus: Moves the message from the .pl file to the template to make
it translatable.

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 9 Katrin Fischer 2020-04-20 16:42:19 UTC
Created attachment 103309 [details] [review]
Bug 14369: Only show 'Create labels' link on staged records import when status is imported

The label creator won't be able to add a batch for items, if they are
not imported into the database (missing itemnumber). This patch hides
the link, when the status is not imported, to avoid the error situation.

To test:
- Export a record with items from your Koha installation
- Delete items and record from Koha
- Stage the record with the items - the "Create labels" link should be showing
- Try to create the labels - note error
- Apply patch
- Retry - the link should no longer show
- Import the records - the link should show now
- Create labels again - a new batch should have been created
- Verify the link on the batch # leads to the batch in the labels module

Bonus: Moves the message from the .pl file to the template to make
it translatable.

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 10 Martin Renvoize 2020-04-21 11:31:48 UTC
Nice work everyone!

Pushed to master for 20.05
Comment 11 Joy Nelson 2020-05-07 21:53:16 UTC
Backported to 19.11.x for 19.11.06
Comment 12 Lucas Gass 2020-05-14 18:01:35 UTC
doesn't apply to 19.05.x, no backport