Bugzilla – Attachment 49765 Details for
Bug 16177
Tests for ColumnsSettings are failing
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 16177: Fix tests for ColumnsSsettings.t
Bug-16177-Fix-tests-for-ColumnsSsettingst.patch (text/plain), 3.19 KB, created by
Mark Tompsett
on 2016-04-01 04:41:09 UTC
(
hide
)
Description:
Bug 16177: Fix tests for ColumnsSsettings.t
Filename:
MIME Type:
Creator:
Mark Tompsett
Created:
2016-04-01 04:41:09 UTC
Size:
3.19 KB
patch
obsolete
>From fa8465887c077c99d60de8c62852ce8da22f2c0c Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 31 Mar 2016 08:59:29 +0100 >Subject: [PATCH] Bug 16177: Fix tests for ColumnsSsettings.t > >This failure has been introduced by > commit 243b797dd11bc0ac1f475195ab765ffbf2220f8b > Bug 15285: Update common files > >This is because the cannot_be_modified key is not always created by >C4::Utils::DataTables::ColumnsSettings subroutines > >Test plan: > prove t/db_dependent/ColumnsSettings.t >should return green >And you can also test a table where the feature is set and a column >cannot be modified from the admin page. > >NOTE: Works as described. I was pondering this potential > solution when I found it in bugzilla. > >Signed-off-by: Mark Tompsett <mtompset@hotmail.com> >--- > C4/Utils/DataTables/ColumnsSettings.pm | 3 +++ > t/db_dependent/ColumnsSettings.t | 5 +++++ > 2 files changed, 8 insertions(+) > >diff --git a/C4/Utils/DataTables/ColumnsSettings.pm b/C4/Utils/DataTables/ColumnsSettings.pm >index 6a804c4..a107886 100644 >--- a/C4/Utils/DataTables/ColumnsSettings.pm >+++ b/C4/Utils/DataTables/ColumnsSettings.pm >@@ -50,6 +50,7 @@ sub get_columns { > $columns = [ map { > { > cannot_be_toggled => exists $_->{cannot_be_toggled} ? $_->{cannot_be_toggled} : 0, >+ cannot_be_modified => exists $_->{cannot_be_modified} ? $_->{cannot_be_modified} : 0, > is_hidden => exists $_->{is_hidden} ? $_->{is_hidden} : 0, > columnname => $_->{columnname}, > } >@@ -69,6 +70,8 @@ sub get_modules { > @{ $list->{modules}{ $c->module }{ $c->page }{ $c->tablename } }; > $column->{is_hidden} = $c->is_hidden; > $column->{cannot_be_toggled} = $c->cannot_be_toggled; >+ $column->{cannot_be_modified} = 0 >+ unless exists $column->{cannot_be_modified}; > } > > return $list->{modules}; >diff --git a/t/db_dependent/ColumnsSettings.t b/t/db_dependent/ColumnsSettings.t >index 460d547..da75931 100644 >--- a/t/db_dependent/ColumnsSettings.t >+++ b/t/db_dependent/ColumnsSettings.t >@@ -133,26 +133,31 @@ my $modules_expected = { > { > columnname => 'symbol', > cannot_be_toggled => 0, >+ cannot_be_modified => 0, > is_hidden => 0, > }, > { > columnname => 'iso_code', > cannot_be_toggled => 0, >+ cannot_be_modified => 0, > is_hidden => 0, > }, > { > columnname => 'last_updated', > cannot_be_toggled => 0, >+ cannot_be_modified => 0, > is_hidden => 0, > }, > { > columnname => 'active', > cannot_be_toggled => 0, >+ cannot_be_modified => 0, > is_hidden => 1, > }, > { > columnname => 'actions', > cannot_be_toggled => 1, >+ cannot_be_modified => 0, > is_hidden => 0, > }, > ] >-- >2.1.4
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 16177
:
49727
|
49765
|
49773