Bugzilla – Attachment 178334 Details for
Bug 35451
Add tablename field to additional_field_values
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35451: Update relations
Bug-35451-Update-relations.patch (text/plain), 4.32 KB, created by
Martin Renvoize (ashimema)
on 2025-02-19 14:26:56 UTC
(
hide
)
Description:
Bug 35451: Update relations
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2025-02-19 14:26:56 UTC
Size:
4.32 KB
patch
obsolete
>From 2198ea22feca4b471b64de09ce8d5923584e9878 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Thu, 30 Nov 2023 11:48:41 +0000 >Subject: [PATCH] Bug 35451: Update relations > >--- > Koha/Schema/Result/Accountline.pm | 6 ++---- > Koha/Schema/Result/Aqbasket.pm | 6 ++---- > Koha/Schema/Result/Aqinvoice.pm | 6 ++---- > Koha/Schema/Result/Aqorder.pm | 7 ++----- > Koha/Schema/Result/Subscription.pm | 6 ++---- > 5 files changed, 10 insertions(+), 21 deletions(-) > >diff --git a/Koha/Schema/Result/Accountline.pm b/Koha/Schema/Result/Accountline.pm >index 1903a552ec6..bbcddc02795 100644 >--- a/Koha/Schema/Result/Accountline.pm >+++ b/Koha/Schema/Result/Accountline.pm >@@ -496,9 +496,7 @@ __PACKAGE__->has_many( > > return { > "$args->{foreign_alias}.record_id" => { -ident => "$args->{self_alias}.accountlines_id" }, >- >- "$args->{foreign_alias}.field_id" => >- { -in => \'(SELECT id FROM additional_fields WHERE tablename LIKE "accountlines:%")' }, >+ "$args->{foreign_alias}.record_table" => __PACKAGE__->table, > }; > }, > { cascade_copy => 0, cascade_delete => 0 }, >@@ -511,4 +509,4 @@ sub koha_object_class { > 'Koha::Account::Line'; > } > >-1; >+1; >\ No newline at end of file >diff --git a/Koha/Schema/Result/Aqbasket.pm b/Koha/Schema/Result/Aqbasket.pm >index eb2ce481b79..eee2e6a921b 100644 >--- a/Koha/Schema/Result/Aqbasket.pm >+++ b/Koha/Schema/Result/Aqbasket.pm >@@ -352,9 +352,7 @@ __PACKAGE__->has_many( > > return { > "$args->{foreign_alias}.record_id" => { -ident => "$args->{self_alias}.basketno" }, >- >- "$args->{foreign_alias}.field_id" => >- { -in => \'(SELECT id FROM additional_fields WHERE tablename = "aqbasket")' }, >+ "$args->{foreign_alias}.record_table" => __PACKAGE__->table, > }; > }, > { cascade_copy => 0, cascade_delete => 0 }, >@@ -390,4 +388,4 @@ __PACKAGE__->add_columns( > '+is_standing' => { is_boolean => 1 } > ); > >-1; >+1; >\ No newline at end of file >diff --git a/Koha/Schema/Result/Aqinvoice.pm b/Koha/Schema/Result/Aqinvoice.pm >index 89fea491df3..fdefdfaef0c 100644 >--- a/Koha/Schema/Result/Aqinvoice.pm >+++ b/Koha/Schema/Result/Aqinvoice.pm >@@ -228,9 +228,7 @@ __PACKAGE__->has_many( > > return { > "$args->{foreign_alias}.record_id" => { -ident => "$args->{self_alias}.invoiceid" }, >- >- "$args->{foreign_alias}.field_id" => >- { -in => \'(SELECT id FROM additional_fields WHERE tablename="aqinvoices")' }, >+ "$args->{foreign_alias}.record_table" => __PACKAGE__->table, > }; > }, > { cascade_copy => 0, cascade_delete => 0 }, >@@ -243,4 +241,4 @@ sub koha_objects_class { > 'Koha::Acquisition::Invoices'; > } > >-1; >+1; >\ No newline at end of file >diff --git a/Koha/Schema/Result/Aqorder.pm b/Koha/Schema/Result/Aqorder.pm >index 2adab1a8b48..e8b66408bfd 100644 >--- a/Koha/Schema/Result/Aqorder.pm >+++ b/Koha/Schema/Result/Aqorder.pm >@@ -891,10 +891,7 @@ __PACKAGE__->has_many( > > return { > "$args->{foreign_alias}.record_id" => { -ident => "$args->{self_alias}.ordernumber" }, >- >- # TODO Add column additional_field_values.tablename to avoid subquery ? >- "$args->{foreign_alias}.field_id" => >- { -in => \'(SELECT id FROM additional_fields WHERE tablename = "aqorders")' }, >+ "$args->{foreign_alias}.record_table" => __PACKAGE__->table, > }; > }, > { cascade_copy => 0, cascade_delete => 0 }, >@@ -912,4 +909,4 @@ __PACKAGE__->add_columns( > '+uncertainprice' => { is_boolean => 1 } > ); > >-1; >+1; >\ No newline at end of file >diff --git a/Koha/Schema/Result/Subscription.pm b/Koha/Schema/Result/Subscription.pm >index bffd28e210b..23e97e87b00 100644 >--- a/Koha/Schema/Result/Subscription.pm >+++ b/Koha/Schema/Result/Subscription.pm >@@ -597,9 +597,7 @@ __PACKAGE__->has_many( > > return { > "$args->{foreign_alias}.record_id" => { -ident => "$args->{self_alias}.subscriptionid" }, >- >- "$args->{foreign_alias}.field_id" => >- { -in => \'(SELECT id FROM additional_fields WHERE tablename = "subscription")' }, >+ "$args->{foreign_alias}.record_table" => __PACKAGE__->table, > }; > }, > { cascade_copy => 0, cascade_delete => 0 }, >@@ -611,4 +609,4 @@ __PACKAGE__->add_columns( > ); > > # You can replace this text with custom content, and it will be preserved on regeneration >-1; >+1; >\ No newline at end of file >-- >2.48.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 35451
:
159390
|
159391
|
159392
|
159393
|
159394
|
159747
|
159748
|
159749
|
159750
|
159751
|
173147
|
173148
|
173149
|
173150
|
173151
|
173421
|
173422
|
173423
|
173424
|
173425
|
178332
|
178333
|
178334
|
178335
|
178336
|
178337
|
178338
|
178339
|
178340
|
178341
|
180806
|
180807
|
180808
|
180809
|
180810
|
182401
|
182402
|
182403
|
182404
|
182405
|
182406
|
182407
|
182408
|
182409
|
182410
|
182411
|
182412
|
182413