[Bug 11518] New: Add new method to Koha::Schema::Result::Item that will always return the correct itemtype
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11518 Bug ID: 11518 Summary: Add new method to Koha::Schema::Result::Item that will always return the correct itemtype Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: gmcharlt@gmail.com Reporter: kyle@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org There are many disparate areas of Koha that deal with item level itemtypes vs record level itemtypes. We can take advantage of DBIx::Class to make smarter objects that automatically return the correct value depending on the system preference. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11518 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|gmcharlt@gmail.com |kyle@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11518 --- Comment #1 from Kyle M Hall <kyle@bywatersolutions.com> --- Just an fyi, I this idea came to me while reading the reports for bug 9448 and bug 11463. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11518 --- Comment #2 from Kyle M Hall <kyle@bywatersolutions.com> --- Not bug 9448, I meant bug 9532 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11518 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11518 --- Comment #3 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 24121 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=24121&action=edit Bug 11518 - Add new method to Koha::Schema::Result::Item that will always return the correct itemtype There are many disparate areas of Koha that deal with item level itemtypes vs record level itemtypes. We can take advantage of DBIx::Class to make smarter objects that automatically return the correct value depending on the system preference. Test Plan: 1) Apply this patch 2) Run t/db_dependent/Items.t -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11518 --- Comment #4 from Kyle M Hall <kyle@bywatersolutions.com> --- In the future we could even override $item->itype() to return the correct value via system preference. Not sure if this would be a good idea or a bad one. In some cases it would likely eliminate accidental bugs. From the DBIC FAQ: How do I override a run time method (e.g. a relationship accessor)? If you need access to the original accessor, then you must "wrap around" the original method. You can do that either with Moose::Manual::MethodModifiers or Class::Method::Modifiers. The code example works for both modules: package Your::Schema::Group; use Class::Method::Modifiers; # ... declare columns ... __PACKAGE__->has_many('group_servers', 'Your::Schema::GroupServer', 'group_id'); __PACKAGE__->many_to_many('servers', 'group_servers', 'server'); # if the server group is a "super group", then return all servers # otherwise return only servers that belongs to the given group around 'servers' => sub { my $orig = shift; my $self = shift; return $self->$orig(@_) unless $self->is_super_group; return $self->result_source->schema->resultset('Server')->all; }; -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11518 --- Comment #5 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 24143 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=24143&action=edit Bug 11518 [Followup] - Change method name from 'itemtype' to 'effective_itemtype' for clarity -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11518 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |11703 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11518 Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #24143|0 |1 is obsolete| | --- Comment #6 from Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no> --- Created attachment 25448 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=25448&action=edit Bug 11518 [Followup] - Change method name from 'itemtype' to 'effective_itemtype' for clarity Test runs without errors. Signed-off-by: Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11518 Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #25448|0 |1 is obsolete| | --- Comment #7 from Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no> --- Created attachment 25510 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=25510&action=edit Bug 11518 [Followup] - Change method name from 'itemtype' to 'effective_itemtype' for clarity Test runs without errors. Signed-off-by: Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11518 Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off CC| |benjamin.rokseth@kul.oslo.k | |ommune.no -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11518 M. de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA CC| |m.de.rooy@rijksmuseum.nl --- Comment #8 from M. de Rooy <m.de.rooy@rijksmuseum.nl> --- QA Comment: I like the idea, but I think that we should not route DBIC modules back to the "ugly C4::Context module" in order to get a preference. Why not do that via DBIC instead here to keep it clean? Note that we could get into circular module dependencies trouble quite easily when we start using from Koha to C4.. Failed QA -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11518 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@biblibre.co | |m --- Comment #9 from Jonathan Druart <jonathan.druart@biblibre.com> --- (In reply to M. de Rooy from comment #8)
QA Comment: I like the idea, but I think that we should not route DBIC modules back to the "ugly C4::Context module" in order to get a preference. Why not do that via DBIC instead here to keep it clean? Note that we could get into circular module dependencies trouble quite easily when we start using from Koha to C4..
Failed QA
I agree, it is too bad to depend on C4::Context but it is the way to get a syspref value. Are you suggesting to get the value directly from the DB? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11518 --- Comment #10 from M. de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Jonathan Druart from comment #9)
I agree, it is too bad to depend on C4::Context but it is the way to get a syspref value. Are you suggesting to get the value directly from the DB?
Maybe it is a better idea to move the syspref function to Koha and DBICify it. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11518 --- Comment #11 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 26983 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=26983&action=edit Bug 11518 [QA Followup] -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11518 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Signed Off -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11518 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #26983|0 |1 is obsolete| | --- Comment #12 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 26985 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=26985&action=edit Bug 11518 [QA Followup] -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11518 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #26985|0 |1 is obsolete| | --- Comment #13 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 26987 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=26987&action=edit Bug 11518 [QA Followup] -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11518 --- Comment #14 from Kyle M Hall <kyle@bywatersolutions.com> --- I should note the unit test for this will now fail until we get the database handles for DBI and DBIx::Class tied together somehow. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11518 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |In Discussion CC| |katrin.fischer@bsz-bw.de --- Comment #15 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- I am not sure what to do with this - as the tests currently not pass, we can't push it to master like it is. It can be tested only in combination with bug 11703, which is currently in status 'FQA' - so is this now 'blocked' - 'failed' or maybe 'in discussion'? What needs to be done to make the tests pass? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11518 --- Comment #16 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 27343 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=27343&action=edit Bug 11518 [QA Followup] - Make unit tests pass -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11518 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|In Discussion |Signed Off -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11518 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #27343|0 |1 is obsolete| | --- Comment #17 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 27344 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=27344&action=edit Bug 11518 [QA Followup] - Make unit tests pass -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11518 --- Comment #18 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 27345 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=27345&action=edit [PASSED QA] Bug 11518 - Add new method to Koha::Schema::Result::Item that will always return the correct itemtype There are many disparate areas of Koha that deal with item level itemtypes vs record level itemtypes. We can take advantage of DBIx::Class to make smarter objects that automatically return the correct value depending on the system preference. Test Plan: 1) Apply this patch 2) Run t/db_dependent/Items.t Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11518 --- Comment #19 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 27346 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=27346&action=edit [PASSED QA] Bug 11518 [Followup] - Change method name from 'itemtype' to 'effective_itemtype' for clarity Test runs without errors. Signed-off-by: Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no> Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11518 --- Comment #20 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 27347 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=27347&action=edit [PASSED QA] Bug 11518 [QA Followup] Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11518 --- Comment #21 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 27348 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=27348&action=edit [PASSED QA] Bug 11518 [QA Followup] - Make unit tests pass Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11518 Katrin Fischer <katrin.fischer@bsz-bw.de> 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=11518 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #27344|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11518 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #24121|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11518 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #26987|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11518 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #25510|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11518 Galen Charlton <gmcharlt@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |rel_3_16_candidate -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11518 Galen Charlton <gmcharlt@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master CC| |gmcharlt@gmail.com --- Comment #22 from Galen Charlton <gmcharlt@gmail.com> --- Pushed to master. Thanks, Kyle! -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11518 --- Comment #23 from Jonathan Druart <jonathan.druart@biblibre.com> --- I really don't understand the complexity of this patch. Why do we want to add extra constraints? In my opinion, the fk constraints exist in DB and we don't want to add more. If we keep the constraints introduced by these patch, we get a 1-n and a 1-1 relations for the same field. I know the current structure (biblio/biblioitems/items) has a lack but I don't think it is the good way to solve it. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11518 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tomascohen@gmail.com -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11518 --- Comment #24 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 29544 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=29544&action=edit Bug 11518: WIP - Remove useless constraints previously added This patch removes the 3 constraints added by patch from bug 11518. Having 1-n + 1-1 relations for the same field is a non-sense. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11518 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #29544|Bug 11518: WIP - Remove |[NOT-PUSHED]Bug 11518: WIP description|useless constraints |- Remove useless |previously added |constraints previously | |added -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11518 --- Comment #25 from M. de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 31240 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=31240&action=edit Bug 11518: Follow-up removing biblioitem routines There is no need to define biblioitem routines, if we can access them via biblioitemnumber. Note that we actually need a FK for biblio in the items table. Now we do need the intermediate level via biblioitems in the Items.t code. Even better, we should move biblioitem to biblio. Formally it is 1-n, but in reality it is 1-1. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11518 M. de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #29544|0 |1 is obsolete| | Attachment #31240|0 |1 is obsolete| | --- Comment #26 from M. de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 31241 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=31241&action=edit Bug 11518: WIP - Remove useless constraints previously added This patch removes the 3 constraints added by patch from bug 11518. Having 1-n + 1-1 relations for the same field is a non-sense. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Added a follow-up for removing some unneeded code. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11518 --- Comment #27 from M. de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 31242 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=31242&action=edit Bug 11518: Follow-up removing biblioitem routines There is no need to define biblioitem routines, if we can access them via biblioitemnumber. Note that we actually need a FK for biblio in the items table. Now we do need the intermediate level via biblioitems in the Items.t code. Even better, we should move biblioitem to biblio. Formally it is 1-n, but in reality it is 1-1. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11518 M. de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Master |ASSIGNED -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11518 M. de Rooy <m.de.rooy@rijksmuseum.nl> 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=11518 --- Comment #28 from M. de Rooy <m.de.rooy@rijksmuseum.nl> --- There still is some discussion about it (see IRC): Why do we use $self->biblioitemnumber()->itemtype() ? $self->biblioitem->itemtype would be nicer. My answer would be: Since the relation is called biblioitemnumber, we need to use that. Using the default relation name from DBIx is easier than adding names everywhere. Same for e.g. $biblioitem->biblionumber() instead of biblio. The generated relation is called biblionumber.. My question is: can we somehow get DBIx to define these relations with the names we like more without adding relation or code in the custom sections everywhere? -- You are receiving this mail because: You are watching all bug changes.
From the DBIx doc: For relationships, belongs_to accessors are made from column names by stripping
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11518 --- Comment #29 from M. de Rooy <m.de.rooy@rijksmuseum.nl> --- postfixes other than _id as well, for example just Id, _?ref, _?cd, _?code and _?num, case insensitively. If we could a postfix id and number, we would be there?? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11518 M. de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |http://bugs.koha-community. | |org/bugzilla3/show_bug.cgi? | |id=12603 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11518 --- Comment #30 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- I think our ids are named quite differently across tables, so I am not sure if number and id would be enough. Also a little worried that if we change too much about the DBIC configuration, this will make it harder to use especially for new developers at some point. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11518 --- Comment #31 from David Cook <dcook@prosentient.com.au> --- Comment on attachment 27345 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=27345 [PASSED QA] Bug 11518 - Add new method to Koha::Schema::Result::Item that will always return the correct itemtype Review of attachment 27345: --> (http://bugs.koha-community.org/bugzilla3/page.cgi?id=splinter.html&bug=11518&attachment=27345) ----------------------------------------------------------------- ::: Koha/Schema/Result/Biblio.pm @@ +331,4 @@
# Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-10-14 20:56:21 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:0//8OGf7OteNnwT03g4QsA
+__PACKAGE__->belongs_to(
I think this already exists in master... ...and that it's not a good idea. biblio.biblionumber is a primary key. If anything, biblioitems.biblio should have a belongs_to() relationship to biblio.biblionumber rather than the other way around. Of course, I think this is here so that we can grab the associated BiblioItems object using the 'biblioitem' accessor... but it seems like a hack to me. ::: Koha/Schema/Result/Item.pm @@ +618,4 @@
{ "foreign.biblionumber" => "self.biblionumber" } );
+__PACKAGE__->belongs_to(
I think this relationship makes sense, but if we're adding a relationship in DBIC, we should probably be adding it in the database as well. @@ +624,5 @@
+ { biblioitemnumber => "biblioitemnumber" }, +); + +use C4::Context; +sub itemtype {
I think this makes sense (insofar as it makes sense to have an item type stored at the biblio level that is). -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11518 --- Comment #32 from Jonathan Druart <jonathan.druart@biblibre.com> --- (In reply to David Cook from comment #31)
Comment on attachment 27345 [details] [review]
Hello David, Did you see that the belongs_to relations are removed in another patch? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11518 Mason James <mtj@kohaaloha.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mtj@kohaaloha.com --- Comment #33 from Mason James <mtj@kohaaloha.com> --- this needs to be added to 3.16.x, as 'ajax-circ' feature (11703) depends on it i'll only attempt to pull QAed patches from this set keyword: rel_3_16_7_candidate -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11518 --- Comment #34 from Mason James <mtj@kohaaloha.com> --- (In reply to Mason James from comment #33)
this needs to be added to 3.16.x, as 'ajax-circ' feature (11703) depends on it
i'll only attempt to pull QAed patches from this set
keyword: rel_3_16_7_candidate
4 patches pushed to 3.16.7 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11518 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |13713 --- Comment #35 from Jonathan Druart <jonathan.druart@biblibre.com> --- 2 last patches moved to bug 13713. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11518 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org