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>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
$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},
}
@{ $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};
{
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,
},
]