Bugzilla – Attachment 189022 Details for
Bug 39438
Add additional fields to agreements periods
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 39438: Add DBIC schema relationships for agreement period additional fields
Bug-39438-Add-DBIC-schema-relationships-for-agreem.patch (text/plain), 2.24 KB, created by
Jonathan Druart
on 2025-11-04 15:21:46 UTC
(
hide
)
Description:
Bug 39438: Add DBIC schema relationships for agreement period additional fields
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2025-11-04 15:21:46 UTC
Size:
2.24 KB
patch
obsolete
>From 2c41115c1fa225bada624793e2060234575daa45 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@openfifth.co.uk> >Date: Fri, 31 Oct 2025 09:15:31 +0000 >Subject: [PATCH] Bug 39438: Add DBIC schema relationships for agreement period > additional fields > >This patch adds the required DBIx::Class relationship definitions to >Koha::Schema::Result::ErmAgreementPeriod to support additional fields >and extended attributes on agreement periods. > >Two has_many relationships are added: >- additional_field_values: links to all additional field values >- extended_attributes: alias for additional_field_values > >Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> >--- > Koha/Schema/Result/ErmAgreementPeriod.pm | 33 ++++++++++++++++++++++++ > 1 file changed, 33 insertions(+) > >diff --git a/Koha/Schema/Result/ErmAgreementPeriod.pm b/Koha/Schema/Result/ErmAgreementPeriod.pm >index d7c74bacae8..47c256a961a 100644 >--- a/Koha/Schema/Result/ErmAgreementPeriod.pm >+++ b/Koha/Schema/Result/ErmAgreementPeriod.pm >@@ -120,6 +120,39 @@ __PACKAGE__->belongs_to( > # Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-05-25 11:46:59 > # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:NCQpSw+rp/9B/yOrtLtK6g > >+__PACKAGE__->has_many( >+ "additional_field_values", >+ "Koha::Schema::Result::AdditionalFieldValue", >+ sub { >+ my ($args) = @_; >+ >+ return { >+ "$args->{foreign_alias}.record_id" => { -ident => "$args->{self_alias}.agreement_period_id" }, >+ >+ "$args->{foreign_alias}.field_id" => >+ { -in => \'(SELECT id FROM additional_fields WHERE tablename="erm_agreement_periods")' }, >+ }; >+ }, >+ { cascade_copy => 0, cascade_delete => 0 }, >+); >+ >+__PACKAGE__->has_many( >+ "extended_attributes", >+ "Koha::Schema::Result::AdditionalFieldValue", >+ sub { >+ my ($args) = @_; >+ >+ return { >+ "$args->{foreign_alias}.record_id" => { -ident => "$args->{self_alias}.agreement_period_id" }, >+ >+ "$args->{foreign_alias}.field_id" => >+ { -in => \'(SELECT id FROM additional_fields WHERE tablename="erm_agreement_periods")' }, >+ }; >+ }, >+ { cascade_copy => 0, cascade_delete => 0 }, >+); >+ >+ > =head2 koha_object_class > > Missing POD for koha_object_class. >-- >2.34.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 39438
:
188307
|
188778
|
188779
|
189021
| 189022 |
189023