Bugzilla – Attachment 173149 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), 3.64 KB, created by
Martin Renvoize (ashimema)
on 2024-10-22 13:46:06 UTC
(
hide
)
Description:
Bug 35451: Update relations
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2024-10-22 13:46:06 UTC
Size:
3.64 KB
patch
obsolete
>From 6e06d517b382b9e189454716014c44427371f1af 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 | 4 +--- > Koha/Schema/Result/Aqbasket.pm | 4 +--- > Koha/Schema/Result/Aqinvoice.pm | 4 +--- > Koha/Schema/Result/Aqorder.pm | 5 +---- > Koha/Schema/Result/Subscription.pm | 4 +--- > 5 files changed, 5 insertions(+), 16 deletions(-) > >diff --git a/Koha/Schema/Result/Accountline.pm b/Koha/Schema/Result/Accountline.pm >index d1ba673cf2d..793699b3b3b 100644 >--- a/Koha/Schema/Result/Accountline.pm >+++ b/Koha/Schema/Result/Accountline.pm >@@ -447,9 +447,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 }, >diff --git a/Koha/Schema/Result/Aqbasket.pm b/Koha/Schema/Result/Aqbasket.pm >index eb2ce481b79..7150aaececb 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 }, >diff --git a/Koha/Schema/Result/Aqinvoice.pm b/Koha/Schema/Result/Aqinvoice.pm >index 89fea491df3..0ba2161aa2d 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 }, >diff --git a/Koha/Schema/Result/Aqorder.pm b/Koha/Schema/Result/Aqorder.pm >index 2adab1a8b48..fd819748722 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 }, >diff --git a/Koha/Schema/Result/Subscription.pm b/Koha/Schema/Result/Subscription.pm >index cb5d1533f44..1f476a307a2 100644 >--- a/Koha/Schema/Result/Subscription.pm >+++ b/Koha/Schema/Result/Subscription.pm >@@ -577,9 +577,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 }, >-- >2.47.0
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