[Bug 15451] New: Move the CSV related code to Koha::CsvProfile[s]
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15451 Bug ID: 15451 Summary: Move the CSV related code to Koha::CsvProfile[s] Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: ASSIGNED Severity: enhancement Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: jonathan.druart@bugs.koha-community.org Reporter: jonathan.druart@bugs.koha-community.org QA Contact: testopia@bugs.koha-community.org The code from C4::Csv can easily be replaced by an OO modules in the Koha namespace, using Koha::Object. On the way, the tool script will be rewritten to use this module. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15451 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |15449 Referenced Bugs: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15449 [Bug 15449] Move stuffs to the Koha namespace -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15451 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |15446 Referenced Bugs: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15446 [Bug 15446] Koha::Object[s]->type should be renamed to _type to avoid conflict with column name -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15451 --- Comment #1 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 46108 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=46108&action=edit Bug 15451: Add the 2 new modules Koha::CsvProfile[s] There are based on Koha::Objets. Tests provided. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15451 --- Comment #2 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 46109 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=46109&action=edit Bug 15451: Rewrite the csv profile tool script This page was inconsistent with the other admin and tool pages. The 2 tabs 'New profile' and 'Edit existing profile' were useless, the ergonomic needs to be revisited. This patch applies the same script/page structure as others: by default a table containing all csv profiles is displayed with 2 action links: edit and delete. Test plan: 1/ Create 1+ CSV profiles, with different types (marc and sql) 2/ Update some values using the Edit link 3/ Delete a CSV profile Note: When deleting a CSV profile, it would be great to warn the user if it is used. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15451 --- Comment #3 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 46110 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=46110&action=edit Bug 15451: Koha::CsvProfiles - Remove GetCsvProfilesLoop This subroutine returned the csv profiles for a given type. This could be done easily with the new Koha::CsvProfiles->search method. Test plan: To do at the OPAC and staff interface! 1/ Export a list using a CSV profile 2/ Export your CART using a CSV profile Note that only MARC profiles should be available. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15451 --- Comment #4 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 46111 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=46111&action=edit Bug 15451: Koha::CsvProfiles - Remove GetCsvProfiles This subroutine did the same job as GetCsvProfilesLoop, so this patch applies the same changes as the previous patch. Test plan: 1/ Claim some serials, sql profiles should be listed 2/ Export records using the export tool. MARC profiles should be listed. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15451 --- Comment #5 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 46112 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=46112&action=edit Bug 15451: Koha::CsvProfiles - Remove GetCsvProfileId This subroutine returned the export_format_id for a given profile name. This can be done easily with the Koha::CsvProfiles->search method. Test plan: Export records using the misc/export_records.pl script and the export tool. If you are exporting using the MARC format, the profile filled in the pref ExportWithCsvProfile will be used (or the one passed in parameter of misc/export_records.pl). If you are exporting using the CSV format, you can choose a profile in the dropdown list. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15451 --- Comment #6 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 46113 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=46113&action=edit Bug 15451: Koha::CsvProfiles - Remove GetCsvProfile This subroutine just returned a csv profile for a given id. It is replaced in this patch by a call to Koha::CsvProfiles->find. There is nothing to test here, these changes have been tested in previous patches. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15451 --- Comment #7 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 46114 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=46114&action=edit Bug 15451: Koha::CsvProfiles - Remove the residue This patch erase all traces of C4::Csv since it's not used anymore. All occurrences have been replaced by previous patches to use Koha::CsvProfiles. Note that GetMarcFieldsForCsv was not used prior this patch set. Test plan: git grep 'C4::Csv' should not return any result. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15451 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15451 Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |bgkriegel@gmail.com --- Comment #8 from Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> --- Hi Jonathan and Happy new year :) With all patches applied Tools > CSVprofiles fails with Software error: DBIx::Class::Schema::resultset(): resultset() expects a source name at /home/bgkriegel/kohaclone/Koha/Objects.pm line 237 Test fails with similar error. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15451 --- Comment #9 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to Bernardo Gonzalez Kriegel from comment #8)
Hi Jonathan and Happy new year :)
With all patches applied Tools > CSVprofiles fails with
Software error: DBIx::Class::Schema::resultset(): resultset() expects a source name at /home/bgkriegel/kohaclone/Koha/Objects.pm line 237
Test fails with similar error.
Thanks for testing Bernardo, happy new year too ;) You should apply bug 15446 before. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15451 --- Comment #10 from Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> --- (In reply to Jonathan Druart from comment #9)
You should apply bug 15446 before. Done, now works more.
I'm testing in order, all patches applied. First 3 Ok. When testing 4th, /cgi-bin/koha/tools/export.pl gives the same/similar error of comment #8, Software error: DBIx::Class::Schema::resultset(): resultset() expects a source name at /home/bgkriegel/kohaclone/Koha/Objects.pm line 235 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15451 --- Comment #11 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to Bernardo Gonzalez Kriegel from comment #10)
I'm testing in order, all patches applied. First 3 Ok.
I add a test plan on each patch to explain what I do, but to test them, you have to apply the entire patch set (well, in a dream world you should not, but I am not perfect :p). -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15451 --- Comment #12 from Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> --- (In reply to Jonathan Druart from comment #11)
(In reply to Bernardo Gonzalez Kriegel from comment #10)
I'm testing in order, all patches applied. First 3 Ok.
I add a test plan on each patch to explain what I do, but to test them, you have to apply the entire patch set (well, in a dream world you should not, but I am not perfect :p).
Hehe :) I applied all patches, and follow each test plan before sign. But on current master (e2a3b93860740fd498baad35fc8a4dc859527cb9), on top of 15446 $ git status On branch bug_15451 Your branch is ahead of 'origin/master' by 10 commits Go to Tools > Export data and got the error described on comment #10 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15451 --- Comment #13 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to Bernardo Gonzalez Kriegel from comment #12) Sorry Bernardo, I tested on my local branch, which was not updated. I have attached new patch on bug 15446, some occurrences of 'sub type' have been pushed in the meanwhile. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15451 --- Comment #14 from Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> --- (In reply to Jonathan Druart from comment #13)
(In reply to Bernardo Gonzalez Kriegel from comment #12)
Sorry Bernardo, I tested on my local branch, which was not updated. I have attached new patch on bug 15446, some occurrences of 'sub type' have been pushed in the meanwhile.
With all patches from 15446 and this, exporting a range of biblios to marc/xml/cvs, with/without ExportWithCsvProfile Inside the file (marc/xml/csv) <h1>Software error:</h1> <pre>Can't locate object method "export_format_id" via package "Koha::CsvProfiles" at /home/bgkriegel/kohaclone/tools/export.pl line 196. </pre> On logs export.pl: Can't locate object method "export_format_id" via package "Koha::CsvProfiles" -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15451 --- Comment #15 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 46306 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=46306&action=edit Bug 15451: Do not considered a Resultset as a Result The previous calls were wrong, but there is something bad with the DB structure: export_format.profile should be a unique key. This patch fixes the previous calls and add a FIXME not to forget to fix the DB structure. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15451 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |15475 Referenced Bugs: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15475 [Bug 15475] export_format.profile should be a unique key -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15451 --- Comment #16 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to Jonathan Druart from comment #15)
Created attachment 46306 [details] [review] Bug 15451: Do not considered a Resultset as a Result
The previous calls were wrong, but there is something bad with the DB structure: export_format.profile should be a unique key. This patch fixes the previous calls and add a FIXME not to forget to fix the DB structure.
I have opened bug 15475. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15451 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |15498 Referenced Bugs: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15498 [Bug 15498] Replace ExportWithCsvProfile with ExportCircHistory -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org