http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10212 --- Comment #85 from David Cook <dcook@prosentient.com.au> --- Comment on attachment 29882 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=29882 [PASSED QA] Bug 10212: Columns configuration for tables Review of attachment 29882: --> (http://bugs.koha-community.org/bugzilla3/page.cgi?id=splinter.html&bug=10212&attachment=29882) ----------------------------------------------------------------- ::: C4/Utils/DataTables/ColumnsSettings.pm @@ +66,5 @@
+ for my $c (@$columns) { + $c->{is_hidden} //= 0; + $c->{cannot_be_toggled} //= 0; + + my $column = $schema->resultset('ColumnsSetting')->search(
Have you considered using "update_or_create" instead of these 3 methods? Admittedly, I'm not sure what about the significance of "$column = $column->first;" below. However, if that's the case, I'd suggest "find_or_new" or "find_or_create". http://search.cpan.org/~ribasushi/DBIx-Class-0.08270/lib/DBIx/Class/ResultSe... my $column = $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}, }); Regardless of whether you choose to go with this method, I think it would be a good idea to add a primary key constraint to your DbiC methods. I haven't looked at the proposed table structure, so I don't know if there are any, but probably a good idea. -- You are receiving this mail because: You are watching all bug changes.