[Bug 12859] New: Patron import tool doent importing extened attributes values
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12859 Bug ID: 12859 Summary: Patron import tool doent importing extened attributes values Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Tools Assignee: gmcharlt@gmail.com Reporter: abl@biblos.pk.edu.pl QA Contact: testopia@bugs.koha-community.org To reproduce: 1/ define/set up extended pattron attribute in administration module, 2/ using "Tools -> Import patrons", try to import some sample patron record[s], having some arbitrary (non-empty) value assigned in 'pattron_attributes' CSV column for attribute defined in step 1/, 3/ observe that extended attribute defined in step 1/ was not imported (not added to the database), without any warnings. Ad. 1: Note that it's also strictly necessary to have all possible extended attributes types which may be present in CSV import file defined in the administration, before performing an import; if even one of them is not defined, all other extended attributes for a given patron are being silently skipped as well. But that's outside of the scope of this particular bug. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12859 Jacek Ablewicz <abl@biblos.pk.edu.pl> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Patron import tool doent |Patron import tool doesn't |importing extened |import extened attributes |attributes values |values any longer -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12859 Jacek Ablewicz <ablewicz@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff Patch complexity|--- |Trivial patch -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12859 --- Comment #1 from Jacek Ablewicz <ablewicz@gmail.com> --- Created attachment 31319 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=31319&action=edit Bug 12859 - Patron import tool doesn't import extened attributes values any longer To reproduce: 1/ define/set up extended pattron attribute in administration module, 2/ using "Tools -> Import patrons", try to import some sample patron record[s], having some arbitrary (non-empty) value assigned in 'pattron_attributes' CSV column for attribute defined in step 1/, 3/ observe that extended attribute defined in step 1/ was not imported (not added to the database), without any warnings. This patch restores a small code chunk which went AWOL somewhere around commit b4158f2d2485c9e57bd7f14362b210732bef9d35. To test: 1/ apply patch & retest, 3/ ensure that this issue is no longer reproductible, and there are no apparent regressions of any kind, 4/ make sure that the ability to specify default value for extended attributes added in bug Bug 12716 is still working as intended (= follow up the test plan for bug 12716). -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12859 Jacek Ablewicz <abl@biblos.pk.edu.pl> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|gmcharlt@gmail.com |abl@biblos.pk.edu.pl -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12859 Jacek Ablewicz <abl@biblos.pk.edu.pl> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |http://bugs.koha-community. | |org/bugzilla3/show_bug.cgi? | |id=12716 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12859 Petter Goksøyr Åsen <boutrosboutrosboutros@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |boutrosboutrosboutros@gmail | |.com --- Comment #2 from Petter Goksøyr Åsen <boutrosboutrosboutros@gmail.com> --- I recently run into this bug, and can confirm that this patch sovles it. I'm happy to sign off, only I couldn't get it to work to specify default value for extended attribute. How is the syntax for that? Same as in the CSV? I tried all variants with quotes and without quotes, but no luck.. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12859 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |katrin.fischer@bsz-bw.de --- Comment #3 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Hi Petter, not sure what you mean by default, can you give an example? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12859 --- Comment #4 from Petter Goksøyr Åsen <boutrosboutrosboutros@gmail.com> --- Hi Katrin, I was refering to step 4 in the test plan above. In cgi-bin/koha/tools/import_borrowers.pl there is a form titled "default values" where you can specify default values for any of the columns in the CSV, including the column patron_attributes, which contain the extended patron attributes. It works for the standard columns that correspond to fields in the borrowers table, but I could't get it to work for the patron_attributes column, which is inserted into the borrower_attributes table. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12859 --- Comment #5 from Jacek Ablewicz <abl@biblos.pk.edu.pl> --- (In reply to Petter Goksøyr Åsen from comment #2)
I'm happy to sign off, only I couldn't get it to work to specify default value for extended attribute. How is the syntax for that? Same as in the CSV?
Not the same syntax; for patron_attributes column in csv file, it may be something like that (double/triple quotes) """DPCODE:PK-B"",""KNTPAP:BPK"",""KNTPAP:BWM"",""SHOW_BCODE:1""" but when specified as default value it needs to be in the different format (single quotes around each one of the atrributes, or no quotes at all): "DPCODE:PK-B","KNTPAP:BPK","KNTPAP:BWM","SHOW_BCODE:1" It works (at least for me) when the default values are given in such format. But I only tested some trivial cases ("Ignore this one, keep the existing one": checked, "Replace all patron attributes": checked, no matchpoints defined for extended atrributes). Another possible reason for the attributes not being added to the database is mentioned in comment #0 (Ad.1): in such a case, there would be also some errors in the logfile: import_borrowers.pl: Database returned the following error: Cannot add or update a child row: a foreign key constraint fails (`koha`.`borrower_attributes`, CONSTRAINT `borrower_attributes_ibfk_2` FOREIGN KEY (`code`) REFERENCES `borrower_attribute_types` (`code`) ON DELETE CASCADE ON UPDATE CASCADE) at /home/koha/devkohaclone/C4/Members/Attributes.pm line 232 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12859 --- Comment #6 from Petter Goksøyr Åsen <boutrosboutrosboutros@gmail.com> --- OK this is what I found out: If I remove the patron_attributes column from the CSV, the default values for extended attributes are used. But if the patron_attributes column is present, they are not used. This is different from the other columns, where default values are used if the column is empty for any particular value. Can you confirm this behaviour? I'd still like to sign off, as this patch at least solves import of extended patron attributes from the CSV-file. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12859 --- Comment #7 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- I think as this fixes an accidental regression by putting deleted code back, it should go in as it is. And the new issues found could be on a separate bug. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12859 Petter Goksøyr Åsen <boutrosboutrosboutros@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12859 Petter Goksøyr Åsen <boutrosboutrosboutros@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #31319|0 |1 is obsolete| | --- Comment #8 from Petter Goksøyr Åsen <boutrosboutrosboutros@gmail.com> --- Created attachment 31497 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=31497&action=edit Bug 12859 - Patron import tool doesn't import extened attributes values any longer To reproduce: 1/ define/set up extended pattron attribute in administration module, 2/ using "Tools -> Import patrons", try to import some sample patron record[s], having some arbitrary (non-empty) value assigned in 'pattron_attributes' CSV column for attribute defined in step 1/, 3/ observe that extended attribute defined in step 1/ was not imported (not added to the database), without any warnings. This patch restores a small code chunk which went AWOL somewhere around commit b4158f2d2485c9e57bd7f14362b210732bef9d35. To test: 1/ apply patch & retest, 3/ ensure that this issue is no longer reproductible, and there are no apparent regressions of any kind, 4/ make sure that the ability to specify default value for extended attributes added in bug Bug 12716 is still working as intended (= follow up the test plan for bug 12716). Signed-off-by: Petter Goksoyr Asen <boutrosboutrosboutros@gmail.com> Patch fixes import of extended patron attributes. Step 1-3 in test plan confirmed. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12859 --- Comment #9 from Petter Goksøyr Åsen <boutrosboutrosboutros@gmail.com> ---
I think as this fixes an accidental regression by putting deleted code back, it should go in as it is. And the new issues found could be on a separate bug.
Agreed:) Patch signed off. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12859 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@biblibre.co | |m, tomascohen@gmail.com --- Comment #10 from Jonathan Druart <jonathan.druart@biblibre.com> --- Hello Jacek, I don't know very well this script, but I suspect that all the code which has been removed by the commit you pointed out should be reintroduced. Don't you think? cc Tomas. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12859 --- Comment #11 from Jonathan Druart <jonathan.druart@biblibre.com> --- For example borrowernumber should not be appear on the default values form :) -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12859 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|normal |major -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12859 --- Comment #12 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- As this is already signed off - could we handle the columns in a separate patch? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12859 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12859 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #31497|0 |1 is obsolete| | --- Comment #13 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 31633 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=31633&action=edit Bug 12859 - Patron import tool doesn't import extened attributes values any longer To reproduce: 1/ define/set up extended pattron attribute in administration module, 2/ using "Tools -> Import patrons", try to import some sample patron record[s], having some arbitrary (non-empty) value assigned in 'pattron_attributes' CSV column for attribute defined in step 1/, 3/ observe that extended attribute defined in step 1/ was not imported (not added to the database), without any warnings. This patch restores a small code chunk which went AWOL somewhere around commit b4158f2d2485c9e57bd7f14362b210732bef9d35. To test: 1/ apply patch & retest, 3/ ensure that this issue is no longer reproductible, and there are no apparent regressions of any kind, 4/ make sure that the ability to specify default value for extended attributes added in bug Bug 12716 is still working as intended (= follow up the test plan for bug 12716). Signed-off-by: Petter Goksoyr Asen <boutrosboutrosboutros@gmail.com> Patch fixes import of extended patron attributes. Step 1-3 in test plan confirmed. Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12859 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |12929 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12859 --- Comment #14 from Jonathan Druart <jonathan.druart@biblibre.com> --- (In reply to Katrin Fischer from comment #12)
As this is already signed off - could we handle the columns in a separate patch?
See bug 12929. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12859 --- Comment #15 from Jonathan Druart <jonathan.druart@biblibre.com> --- (In reply to Jonathan Druart from comment #14)
(In reply to Katrin Fischer from comment #12)
As this is already signed off - could we handle the columns in a separate patch?
See bug 12929.
Patch submitted, needs signoff. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12859 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master --- Comment #16 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Patch pushed to master. Thanks Jacek! -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12859 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also|http://bugs.koha-community. | |org/bugzilla3/show_bug.cgi? | |id=12716 | Depends on| |12716 -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org