[Koha-bugs] [Bug 19049] Fix regression on stage-marc-import with to_marc plugin

2017-09-19 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19049

Mason James  changed:

   What|Removed |Added

 CC||m...@kohaaloha.com

--- Comment #31 from Mason James  ---
Blocked by Enhancement (BZ 10407), skipping for 16.05.x

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
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/


[Koha-bugs] [Bug 19049] Fix regression on stage-marc-import with to_marc plugin

2017-09-10 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19049

--- Comment #30 from Katrin Fischer  ---
These patches have been pushed to 16.11.x and will be in 16.11.12.

Fridolin, please take a look at the dependent bug 19163 - it fixes a critical
problem with this patch set!

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
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/


[Koha-bugs] [Bug 19049] Fix regression on stage-marc-import with to_marc plugin

2017-09-06 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19049

Fridolin SOMERS  changed:

   What|Removed |Added

 Status|Pushed to Master|Pushed to Stable
 CC||fridolin.som...@biblibre.co
   ||m

--- Comment #29 from Fridolin SOMERS  ---
Pushed to 17.05.x, will be in 17.05.04

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
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/


[Koha-bugs] [Bug 19049] Fix regression on stage-marc-import with to_marc plugin

2017-08-22 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19049

Marcel de Rooy  changed:

   What|Removed |Added

 Blocks||19163

--- Comment #28 from Marcel de Rooy  ---
This causes a critical bug. See fix on bug 19163


Referenced Bugs:

https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19163
[Bug 19163] Critical typo in stage-marc-import process
-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
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/


[Koha-bugs] [Bug 19049] Fix regression on stage-marc-import with to_marc plugin

2017-08-15 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19049

Jonathan Druart  changed:

   What|Removed |Added

 Status|Passed QA   |Pushed to Master

--- Comment #27 from Jonathan Druart  
---
Pushed to master for 17.11, thanks to everybody involved!

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
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/


[Koha-bugs] [Bug 19049] Fix regression on stage-marc-import with to_marc plugin

2017-08-12 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19049

--- Comment #26 from Katrin Fischer  ---
Wrong bug!

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
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/


[Koha-bugs] [Bug 19049] Fix regression on stage-marc-import with to_marc plugin

2017-08-12 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19049

--- Comment #25 from Katrin Fischer  ---
Marcel commented on this error from the qa script here:
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19049#c11

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
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/


[Koha-bugs] [Bug 19049] Fix regression on stage-marc-import with to_marc plugin

2017-08-11 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19049

Marcel de Rooy  changed:

   What|Removed |Added

  Attachment #65876|0   |1
is obsolete||

--- Comment #24 from Marcel de Rooy  ---
Created attachment 65877
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=65877=edit
Bug 19049: [QA Follow-up] Mock config, default format

As requested by QA:
[1] Mock_config enable_plugins in the test.
[2] Fallback to MARC when format is empty. Remove die statement.
Added:
[3] Remove $marc. This variable got obsolete during development.
[4] Add test on $input_file and $plugin_class. Test $text before calling
Handler or processing $text. No need to split undef if somehow Handler
returned undef, etc. If the routine returns an empty arrayref,
stage-marc-import will do fine.

Signed-off-by: Marcel de Rooy 

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
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/


[Koha-bugs] [Bug 19049] Fix regression on stage-marc-import with to_marc plugin

2017-08-11 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19049

--- Comment #23 from Marcel de Rooy  ---
(In reply to Jonathan Druart from comment #19)
> I would prefer to avoid the die and default to "MARC" if format is not
> passed, especially if we backport this change.

Done.

(In reply to Jonathan Druart from comment #20)
> Must skip tests if enable_plugins is not set in koha-conf.xml or pass it in
> arg.

Fixed. Thanks!

(In reply to Tomás Cohen Arazi from comment #21)
> It has to be mocked IMHO.

YHO is always appreciated.

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
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/

[Koha-bugs] [Bug 19049] Fix regression on stage-marc-import with to_marc plugin

2017-08-11 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19049

Marcel de Rooy  changed:

   What|Removed |Added

 Status|Failed QA   |Passed QA

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
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/


[Koha-bugs] [Bug 19049] Fix regression on stage-marc-import with to_marc plugin

2017-08-11 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19049

--- Comment #22 from Marcel de Rooy  ---
Created attachment 65876
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=65876=edit
Bug 19049: [QA Follow-up] Mock config, default format

As requested by QA:
[1] Mock_config enable_plugins in the test.
[2] Fallback to MARC when format is empty. Remove die statement.
Added:
[3] Remove $marc. This variable got obsolete during development.
[4] Add if to the Handler call and add if around processing $text. No need
to split undef if somehow plugin was not found, etc. If the routine
returns an empty arrayref, stage-marc-import will do fine.

Signed-off-by: Marcel de Rooy 

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
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/


[Koha-bugs] [Bug 19049] Fix regression on stage-marc-import with to_marc plugin

2017-08-10 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19049

--- Comment #21 from Tomás Cohen Arazi  ---
(In reply to Jonathan Druart from comment #20)
> t/db_dependent/ImportBatch.t .. 1/14 # No tests run!
> 
> #   Failed test 'No tests run for subtest "RecordsFromMarcPlugin"'
> #   at t/db_dependent/ImportBatch.t line 199.
> Can't call method "GetPlugins" on an undefined value at
> t/db_dependent/ImportBatch.t line 190.
> 
> 
> Must skip tests if enable_plugins is not set in koha-conf.xml or pass it in
> arg.

It has to be mocked IMHO.

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
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/

[Koha-bugs] [Bug 19049] Fix regression on stage-marc-import with to_marc plugin

2017-08-10 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19049

Jonathan Druart  changed:

   What|Removed |Added

 Status|Passed QA   |Failed QA

--- Comment #20 from Jonathan Druart  
---
t/db_dependent/ImportBatch.t .. 1/14 # No tests run!

#   Failed test 'No tests run for subtest "RecordsFromMarcPlugin"'
#   at t/db_dependent/ImportBatch.t line 199.
Can't call method "GetPlugins" on an undefined value at
t/db_dependent/ImportBatch.t line 190.


Must skip tests if enable_plugins is not set in koha-conf.xml or pass it in
arg.

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
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/


[Koha-bugs] [Bug 19049] Fix regression on stage-marc-import with to_marc plugin

2017-08-10 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19049

Jonathan Druart  changed:

   What|Removed |Added

 CC||jonathan.dru...@bugs.koha-c
   ||ommunity.org

--- Comment #19 from Jonathan Druart  
---
Marcel,

-my $format = $input->param('format') || 'ISO2709';
+my $format = $input->param('format');

Then later:
+} else {
+die "No format specified";
+}

I would prefer to avoid the die and default to "MARC" if format is not passed,
especially if we backport this change.

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
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/


[Koha-bugs] [Bug 19049] Fix regression on stage-marc-import with to_marc plugin

2017-08-10 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19049

--- Comment #18 from Kyle M Hall  ---
Created attachment 65810
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=65810=edit
Bug 19049 [QA Followup] - Make plugin name first item in description

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
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/


[Koha-bugs] [Bug 19049] Fix regression on stage-marc-import with to_marc plugin

2017-08-10 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19049

Kyle M Hall  changed:

   What|Removed |Added

 Status|Signed Off  |Passed QA

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
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/


[Koha-bugs] [Bug 19049] Fix regression on stage-marc-import with to_marc plugin

2017-08-10 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19049

--- Comment #17 from Kyle M Hall  ---
Created attachment 65809
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=65809=edit
Bug 19049: [Follow-up] Make sure that GetPlugins finds the plugin

We have to mock_config the pluginsdir before Plugins is loaded, and
we should pass an absolute path (not a relative one).
If you did not install the test to_marc plugin, this test would fail.

Signed-off-by: Marcel de Rooy 

Signed-off-by: Katrin Fischer 

Signed-off-by: Kyle M Hall 
Verified patch is compatible with original KitchenSink to_marc plugin

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
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/


[Koha-bugs] [Bug 19049] Fix regression on stage-marc-import with to_marc plugin

2017-08-10 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19049

--- Comment #16 from Kyle M Hall  ---
Created attachment 65808
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=65808=edit
Bug 19049: Testing RecordsFromMarcPlugin with a to_marc plugin

This patch adds a simple to_marc plugin in t/Koha/Plugin that is used
in the added subtest in ImportBatch.t.

Test plan:
[1] Run t/db_dependent/ImportBatch.t
[2] Copy the to_marc test plugin from t to your plugin directory.
Under Debian packages, you should do something like:
mkdir -p /var/lib/koha/master/plugins/Koha/Plugin/
cp [yourclone]/t/Koha/Plugin/MarcFieldValues.pm
/var/lib/koha/master/plugins/Koha/Plugin/
[3] Check if you see this plugin on plugins/plugins-home.pl
[4] Create a text file with some fields like:
(Note: The plugin needs an empty line between both "records".)
100,a = Test Author 1
245,a = Title One

100,a = Author 2
245,a = Title Two
[5] Go to stage-marc-import.pl. Upload the created file. Select the plugin
in the format combo and proceed. Did you create two records ?

Signed-off-by: Marcel de Rooy 

Signed-off-by: Katrin Fischer 

Signed-off-by: Kyle M Hall 

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
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/


[Koha-bugs] [Bug 19049] Fix regression on stage-marc-import with to_marc plugin

2017-08-10 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19049

Kyle M Hall  changed:

   What|Removed |Added

  Attachment #65802|0   |1
is obsolete||
  Attachment #65803|0   |1
is obsolete||
  Attachment #65804|0   |1
is obsolete||

--- Comment #15 from Kyle M Hall  ---
Created attachment 65807
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=65807=edit
Bug 19049: Fix regression on stage-marc-import with to_marc plugin

Bug 12412 added the use of to_marc plugins allowing arbitrary file formats
in stage-marc-import (as long as the plugins can handle them). The feature
was not very visible in the code, and when bug 10407 added the marcxml
format, it made some changes that broke the use of to_marc.

This patch restores the functionality by:
[1] Adding a sub RecordsFromMarcPlugin to ImportBatch.pm, specifically
addressing the conversion from arbitrary formats to MARC::Record.
The original to_marc interface is used: pass it the file contents,
and it returns a string consisting of a number of MARC blobs separated
by \x1D.
Consequently, the call of to_marc is removed from routine
BatchStageMarcRecords where it did not belong. The to_marc_plugin
parameter is removed and two calls are adjusted accordingly.
[2] Instead of a separate combo with plugins, the format combo contains
MARC, MARCXML and optionally some plugin formats.
[3] The code in stage-marc-import.pl now clearly shows the three main
format types: MARC, MARCXML or plugin based.

Note: This patch restores more or less the situation after bug 12412, but
I would actually recommend to have the to_marc plugins return MARC::Record
objects instead of large text strings. In the second example I added a
to_marc plugin that actually converts MARC record objects to string format,
while RecordsFromMarcPlugin reconverts them to MARC::Records.

Test plan:
See second patch.

Signed-off-by: Marcel de Rooy 

Signed-off-by: Katrin Fischer 

Signed-off-by: Kyle M Hall 

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
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/


[Koha-bugs] [Bug 19049] Fix regression on stage-marc-import with to_marc plugin

2017-08-10 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19049

--- Comment #12 from Katrin Fischer  ---
Created attachment 65802
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=65802=edit
[SIGNED OFF] Bug 19049: Fix regression on stage-marc-import with to_marc plugin

Bug 12412 added the use of to_marc plugins allowing arbitrary file formats
in stage-marc-import (as long as the plugins can handle them). The feature
was not very visible in the code, and when bug 10407 added the marcxml
format, it made some changes that broke the use of to_marc.

This patch restores the functionality by:
[1] Adding a sub RecordsFromMarcPlugin to ImportBatch.pm, specifically
addressing the conversion from arbitrary formats to MARC::Record.
The original to_marc interface is used: pass it the file contents,
and it returns a string consisting of a number of MARC blobs separated
by \x1D.
Consequently, the call of to_marc is removed from routine
BatchStageMarcRecords where it did not belong. The to_marc_plugin
parameter is removed and two calls are adjusted accordingly.
[2] Instead of a separate combo with plugins, the format combo contains
MARC, MARCXML and optionally some plugin formats.
[3] The code in stage-marc-import.pl now clearly shows the three main
format types: MARC, MARCXML or plugin based.

Note: This patch restores more or less the situation after bug 12412, but
I would actually recommend to have the to_marc plugins return MARC::Record
objects instead of large text strings. In the second example I added a
to_marc plugin that actually converts MARC record objects to string format,
while RecordsFromMarcPlugin reconverts them to MARC::Records.

Test plan:
See second patch.

Signed-off-by: Marcel de Rooy 

Signed-off-by: Katrin Fischer 

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
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/


[Koha-bugs] [Bug 19049] Fix regression on stage-marc-import with to_marc plugin

2017-08-10 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19049

--- Comment #13 from Katrin Fischer  ---
Created attachment 65803
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=65803=edit
[SIGNED OFF] Bug 19049: Testing RecordsFromMarcPlugin with a to_marc plugin

This patch adds a simple to_marc plugin in t/Koha/Plugin that is used
in the added subtest in ImportBatch.t.

Test plan:
[1] Run t/db_dependent/ImportBatch.t
[2] Copy the to_marc test plugin from t to your plugin directory.
Under Debian packages, you should do something like:
mkdir -p /var/lib/koha/master/plugins/Koha/Plugin/
cp [yourclone]/t/Koha/Plugin/MarcFieldValues.pm
/var/lib/koha/master/plugins/Koha/Plugin/
[3] Check if you see this plugin on plugins/plugins-home.pl
[4] Create a text file with some fields like:
(Note: The plugin needs an empty line between both "records".)
100,a = Test Author 1
245,a = Title One

100,a = Author 2
245,a = Title Two
[5] Go to stage-marc-import.pl. Upload the created file. Select the plugin
in the format combo and proceed. Did you create two records ?

Signed-off-by: Marcel de Rooy 

Signed-off-by: Katrin Fischer 

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
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/


[Koha-bugs] [Bug 19049] Fix regression on stage-marc-import with to_marc plugin

2017-08-10 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19049

--- Comment #14 from Katrin Fischer  ---
Created attachment 65804
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=65804=edit
[SIGNED OFF] Bug 19049: [Follow-up] Make sure that GetPlugins finds the plugin

We have to mock_config the pluginsdir before Plugins is loaded, and
we should pass an absolute path (not a relative one).
If you did not install the test to_marc plugin, this test would fail.

Signed-off-by: Marcel de Rooy 

Signed-off-by: Katrin Fischer 

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
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/


[Koha-bugs] [Bug 19049] Fix regression on stage-marc-import with to_marc plugin

2017-08-10 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19049

Katrin Fischer  changed:

   What|Removed |Added

  Attachment #65797|0   |1
is obsolete||

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
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/


[Koha-bugs] [Bug 19049] Fix regression on stage-marc-import with to_marc plugin

2017-08-10 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19049

Katrin Fischer  changed:

   What|Removed |Added

  Attachment #65707|0   |1
is obsolete||

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
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/


[Koha-bugs] [Bug 19049] Fix regression on stage-marc-import with to_marc plugin

2017-08-10 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19049

Katrin Fischer  changed:

   What|Removed |Added

  Attachment #65708|0   |1
is obsolete||

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
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/


[Koha-bugs] [Bug 19049] Fix regression on stage-marc-import with to_marc plugin

2017-08-10 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19049

Katrin Fischer  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
Koha-bugs@lists.koha-community.org
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/


[Koha-bugs] [Bug 19049] Fix regression on stage-marc-import with to_marc plugin

2017-08-10 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19049

--- Comment #11 from Marcel de Rooy  ---
Note for QA

QA Tools gives this warning:
 FAIL   t/Koha/Plugin/MarcFieldValues.pm
   OK critic
   OK forbidden patterns
   OK git manipulation
   OK pod
   FAIL   pod coverage
POD coverage was greater before, try perl
-MPod::Coverage=PackageName -e666
   SKIP   spelling
   OK valid

This is a false negative. Since the t folder is not in the PERL5LIB path, the
module cannot be loaded.

After adding [myclone]/t to PERL5LIB:
perl -MPod::Coverage=Koha::Plugin::MarcFieldValues -e1
RETURNS:
Koha::Plugin::MarcFieldValues has a Pod::Coverage rating of 1

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
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/


[Koha-bugs] [Bug 19049] Fix regression on stage-marc-import with to_marc plugin

2017-08-10 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19049

--- Comment #10 from Marcel de Rooy  ---
Created attachment 65797
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=65797=edit
Bug 19049: [Follow-up] Make sure that GetPlugins finds the plugin

We have to mock_config the pluginsdir before Plugins is loaded, and
we should pass an absolute path (not a relative one).
If you did not install the test to_marc plugin, this test would fail.

Signed-off-by: Marcel de Rooy 

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
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/


[Koha-bugs] [Bug 19049] Fix regression on stage-marc-import with to_marc plugin

2017-08-10 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19049

--- Comment #9 from Katrin Fischer  ---
Sorry Marcel, but tests are failing:

Files=1, Tests=14,  2 wallclock secs ( 0.02 usr  0.00 sys +  1.22 cusr  0.26
csys =  1.50 CPU)
Result: FAIL
kohadev-koha@kohadevbox:/home/vagrant/kohaclone$ perl
t/db_dependent/ImportBatch.t
1..14
ok 1 - use C4::ImportBatch;
ok 2 - AddImportBatch for sample_import_batch1 return an id
ok 3 - AddImportBatch for sample_import_batch2 return an id
ok 4 - GetImportBatch returns the right informations about HASH(0x99e12b8)
ok 5 - GetImportBatch returns the right informations about HASH(0x99e13f0)
ok 6 - GetRecordFromImportBiblio should return the record with items if
specified
ok 7 - GetRecordFromImportBiblio should return the record without items by
default
ok 8 - No item numbers expected since we did not commit
ok 9 - Expecting two items now
ok 10 - Check the first returned itemnumber
ok 11 - No item numbers expected since we deleted the item
ok 12 - Batch 3 has been cleaned
ok 13 - Batch 3 has been deleted
# Subtest: RecordsFromMarcPlugin
1..5
# No tests run!
not ok 14 - No tests run for subtest "RecordsFromMarcPlugin"
#   Failed test 'No tests run for subtest "RecordsFromMarcPlugin"'
#   at t/db_dependent/ImportBatch.t line 195.
Can't call method "GetPlugins" on an undefined value at
t/db_dependent/ImportBatch.t line 186.
# Looks like your test exited with 255 just after 14.

Also QA tool complains about POD coverage, but I think that is less important.

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
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/


[Koha-bugs] [Bug 19049] Fix regression on stage-marc-import with to_marc plugin

2017-08-10 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19049

Marcel de Rooy  changed:

   What|Removed |Added

   Severity|normal  |major

--- Comment #8 from Marcel de Rooy  ---
Increasing Severity

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
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/


[Koha-bugs] [Bug 19049] Fix regression on stage-marc-import with to_marc plugin

2017-08-09 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19049

--- Comment #7 from Marcel de Rooy  ---
Your assistance in testing this is appreciated now.
Would be nice too if we could backport this to 17.05 and 16.11 sooner.

Looking at the code changes, that should be possible. The first patch actually
applies under 16.11. The GetPlugins call with metadata should also work under
16.11 in the test script.

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
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/


[Koha-bugs] [Bug 19049] Fix regression on stage-marc-import with to_marc plugin

2017-08-09 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19049

Marcel de Rooy  changed:

   What|Removed |Added

 CC||katrin.fisc...@bsz-bw.de,
   ||k...@bywatersolutions.com

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
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/


[Koha-bugs] [Bug 19049] Fix regression on stage-marc-import with to_marc plugin

2017-08-09 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19049

Marcel de Rooy  changed:

   What|Removed |Added

  Attachment #65656|0   |1
is obsolete||

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
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/


[Koha-bugs] [Bug 19049] Fix regression on stage-marc-import with to_marc plugin

2017-08-09 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19049

Marcel de Rooy  changed:

   What|Removed |Added

  Attachment #65655|0   |1
is obsolete||

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
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/


[Koha-bugs] [Bug 19049] Fix regression on stage-marc-import with to_marc plugin

2017-08-09 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19049

Marcel de Rooy  changed:

   What|Removed |Added

 Status|ASSIGNED|Needs Signoff
 CC||m.de.r...@rijksmuseum.nl

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
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/


[Koha-bugs] [Bug 19049] Fix regression on stage-marc-import with to_marc plugin

2017-08-09 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19049

--- Comment #6 from Marcel de Rooy  ---
Created attachment 65708
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=65708=edit
Bug 19049: Testing RecordsFromMarcPlugin with a to_marc plugin

This patch adds a simple to_marc plugin in t/Koha/Plugin that is used
in the added subtest in ImportBatch.t.

Test plan:
[1] Run t/db_dependent/ImportBatch.t
[2] Copy the to_marc test plugin from t to your plugin directory.
Under Debian packages, you should do something like:
mkdir -p /var/lib/koha/master/plugins/Koha/Plugin/
cp [yourclone]/t/Koha/Plugin/MarcFieldValues.pm
/var/lib/koha/master/plugins/Koha/Plugin/
[3] Check if you see this plugin on plugins/plugins-home.pl
[4] Create a text file with some fields like:
(Note: The plugin needs an empty line between both "records".)
100,a = Test Author 1
245,a = Title One

100,a = Author 2
245,a = Title Two
[5] Go to stage-marc-import.pl. Upload the created file. Select the plugin
in the format combo and proceed. Did you create two records ?

Signed-off-by: Marcel de Rooy 

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
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/


[Koha-bugs] [Bug 19049] Fix regression on stage-marc-import with to_marc plugin

2017-08-09 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19049

--- Comment #5 from Marcel de Rooy  ---
Created attachment 65707
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=65707=edit
Bug 19049: Fix regression on stage-marc-import with to_marc plugin

Bug 12412 added the use of to_marc plugins allowing arbitrary file formats
in stage-marc-import (as long as the plugins can handle them). The feature
was not very visible in the code, and when bug 10407 added the marcxml
format, it made some changes that broke the use of to_marc.

This patch restores the functionality by:
[1] Adding a sub RecordsFromMarcPlugin to ImportBatch.pm, specifically
addressing the conversion from arbitrary formats to MARC::Record.
The original to_marc interface is used: pass it the file contents,
and it returns a string consisting of a number of MARC blobs separated
by \x1D.
Consequently, the call of to_marc is removed from routine
BatchStageMarcRecords where it did not belong. The to_marc_plugin
parameter is removed and two calls are adjusted accordingly.
[2] Instead of a separate combo with plugins, the format combo contains
MARC, MARCXML and optionally some plugin formats.
[3] The code in stage-marc-import.pl now clearly shows the three main
format types: MARC, MARCXML or plugin based.

Note: This patch restores more or less the situation after bug 12412, but
I would actually recommend to have the to_marc plugins return MARC::Record
objects instead of large text strings. In the second example I added a
to_marc plugin that actually converts MARC record objects to string format,
while RecordsFromMarcPlugin reconverts them to MARC::Records.

Test plan:
See second patch.

Signed-off-by: Marcel de Rooy 

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
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/


[Koha-bugs] [Bug 19049] Fix regression on stage-marc-import with to_marc plugin

2017-08-09 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19049

Marcel de Rooy  changed:

   What|Removed |Added

Summary|Recover the Arbitrary file  |Fix regression on
   |type on stage-marc-import   |stage-marc-import with
   |with plugin to_marc |to_marc plugin

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
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/