Bugzilla – Attachment 29947 Details for
Bug 10212
Columns configuration for tables
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 10212: Use the update_or_create DBIC method when possible
Bug-10212-Use-the-updateorcreate-DBIC-method-when-.patch (text/plain), 2.24 KB, created by
Jonathan Druart
on 2014-07-22 08:23:27 UTC
(
hide
)
Description:
Bug 10212: Use the update_or_create DBIC method when possible
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2014-07-22 08:23:27 UTC
Size:
2.24 KB
patch
obsolete
>From 1e02484d933e97be5a26556c67ecf70e974b72dd Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Tue, 22 Jul 2014 10:21:53 +0200 >Subject: [PATCH] Bug 10212: Use the update_or_create DBIC method when possible > >Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> >--- > C4/Utils/DataTables/ColumnsSettings.pm | 29 +++-------------------------- > 1 file changed, 3 insertions(+), 26 deletions(-) > >diff --git a/C4/Utils/DataTables/ColumnsSettings.pm b/C4/Utils/DataTables/ColumnsSettings.pm >index 8b8c79f..ed8d9ac 100644 >--- a/C4/Utils/DataTables/ColumnsSettings.pm >+++ b/C4/Utils/DataTables/ColumnsSettings.pm >@@ -67,39 +67,16 @@ sub update_columns { > $c->{is_hidden} //= 0; > $c->{cannot_be_toggled} //= 0; > >- my $column = $schema->resultset('ColumnsSetting')->search( >+ $schema->resultset('ColumnsSetting')->update_or_create( > { > module => $c->{module}, > page => $c->{page}, > tablename => $c->{tablename}, > columnname => $c->{columnname}, >+ is_hidden => $c->{is_hidden}, >+ cannot_be_toggled => $c->{cannot_be_toggled}, > } > ); >- if ( $column->count ) { >- $column = $column->first; >- $column->update( >- { >- module => $c->{module}, >- page => $c->{page}, >- tablename => $c->{tablename}, >- columnname => $c->{columnname}, >- is_hidden => $c->{is_hidden}, >- cannot_be_toggled => $c->{cannot_be_toggled}, >- } >- ); >- } >- else { >- $schema->resultset('ColumnsSetting')->create( >- { >- module => $c->{module}, >- page => $c->{page}, >- tablename => $c->{tablename}, >- columnname => $c->{columnname}, >- is_hidden => $c->{is_hidden}, >- cannot_be_toggled => $c->{cannot_be_toggled}, >- } >- ); >- } > } > } > >-- >2.0.0.rc2
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 10212
:
17978
|
17979
|
18861
|
20625
|
20640
|
21178
|
21179
|
21180
|
21583
|
21584
|
21585
|
24083
|
24084
|
24085
|
24149
|
24150
|
24151
|
24167
|
24168
|
24577
|
27700
|
27701
|
27702
|
27703
|
27704
|
27705
|
29075
|
29076
|
29077
|
29078
|
29079
|
29080
|
29537
|
29538
|
29539
|
29540
|
29541
|
29701
|
29702
|
29703
|
29704
|
29705
|
29718
|
29830
|
29836
|
29837
|
29838
|
29839
|
29840
|
29841
|
29842
|
29882
|
29883
|
29884
|
29885
|
29886
|
29887
|
29888
| 29947 |
31158
|
31159