[Koha-bugs] [Bug 20265] Add syspref to hide news published date

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Wed Mar 28 08:29:12 CEST 2018


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20265

--- Comment #6 from Katrin Fischer <katrin.fischer at bsz-bw.de> ---
Comment on attachment 72387
  --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=72387
This patch adds a system preference that allows a user to toggle the published
date for OPAC news items on or off.

Review of attachment 72387:
 --> (https://bugs.koha-community.org/bugzilla3/page.cgi?id=splinter.html&bug=20265&attachment=72387)
-----------------------------------------------------------------

Hi Dilan,

I am a bit reluctant about this patch, as it's a really easy fix with CSS that
could go into the CSS library on the wiki:
https://wiki.koha-community.org/wiki/HTML_%26_CSS_Library

There are some sentiments about not adding too many new system preferences and
while I am in sys prefs fan club, this appears to be a very granular one with
an easy fix using existing customizing patterns. Please still feel free to ask
for others opinions!

I still have done a full review and hope you'll find the comments helpful:

1) Patch file:
Author is missing, pleas check your git configuration so the patch is properly
attributed to you.
Author: Your Full Name <your_email>

The first line of a patch always needs to start with: Bug XXXXX: short
description, see here:
https://wiki.koha-community.org/wiki/Commit_messages

There are some special characters in your patch that don't work so well on
command line, 
better to stick with ASCII where possible: → ” This might be from copying from
word or similar? 
Better to stick with a simple editor.

2) There are a lot of unrelated changes in opac-main.tt and I am not sure about
your approach with the CSS. If using a pref, no CSS should be necessary, as you
can just 'kill' the element form the output. Maybe I am misunderstanding what
you were trying to do?

3) Splinter comments:

::: installer/data/mysql/atomicupdate/bug_20265-OPACNoNewsDate_syspref.perl
@@ +1,4 @@
> +$DBversion = 'XXX';  # will be replaced by the RM
> +if( CheckVersion( $DBversion ) ) {
> +    # you can use $dbh here like:
> +    $dbh->do( "INSERT INTO `systempreferences` VALUES ('OPACNoNewsDate','1','','the published date in news items on the OPAC.','YesNo');" );

Please always use INSERT IGNORE when adding new system preferences.

::: installer/data/mysql/sysprefs.sql
@@ +281,4 @@
>  ('NoIssuesChargeGuarantees','','','Define maximum amount withstanding before check outs are blocked','Integer'),
>  ('noItemTypeImages','0',NULL,'If ON, disables item-type images','YesNo'),
>  ('NoLoginInstructions', '', '60|10', 'Instructions to display on the OPAC login form when a patron is not logged in', 'Textarea'),
> +('OPACNoNewsDate','1','','the published date in news items on the OPAC.','YesNo'),

The sysprefs.sql file is sorted alphabetically to minimize conflicts - please
make sure to always add your new line in the right spot.

::: koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref
@@ +1,2 @@
> +---
> +opac.pref:

You have removed the first line and a lot of whitespace changes have happened -
something has really gone wrong here. Please take another look at the file.

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list