[Koha-bugs] [Bug 7567] News by Library: refactor, enhance, and fix
bugzilla-daemon at bugs.koha-community.org
bugzilla-daemon at bugs.koha-community.org
Wed Mar 26 13:54:44 CET 2014
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7567
Jonathan Druart <jonathan.druart at biblibre.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|Signed Off |Failed QA
--- Comment #68 from Jonathan Druart <jonathan.druart at biblibre.com> ---
QA comment:
1)
+ $template->param( $lang => 1 ) if $lang;
Why ? Seems not used in template. But maybe I am wrong.
2)
- # $query.= "LIMIT 0, " . $limit;
+ # $query.= 'LIMIT 0, ' . $limit;
Could be removed
3)
+ if ($lang && $branchcode) {
+ $query .= " WHERE (opac_news.lang='' OR opac_news.lang=?)";
+ $query .= " AND (opac_news.branchcode IS NULL OR
opac_news.branchcode=?)";
+ push @values,$lang;
+ push @values,$branchcode;
+ }
+ elsif ($lang) {
+ $query .= " WHERE (opac_news.lang='' OR opac_news.lang=?)";
+ push @values,$lang;
+ }
+ elsif ($branchcode) {
+ $query .= " WHERE (opac_news.branchcode IS NULL OR
opac_news.branchcode=?)";
+ push @values,$branchcode;
+ }
Maybe the following is more readable:
$query .= " WHERE 1 ";
if ( $lang ) {
$query .= "AND (opac_news.lang='' OR opac_news.lang=?)";
push @values, $lang
}
and same for $branchcode
4) s/branch/library in templates
5) in opac-main.tt
- [% IF ( koha_news_count ) %]
<div id="news" class="container">
+ [% IF ( koha_news_count ) %]
Why? It will produce an empty div.
6)
Some QA issues (minor):
FAIL koha-tmpl/intranet-tmpl/prog/en/modules/tools/koha-news.tt
FAIL forbidden patterns
forbidden pattern: tab char (line 233)
forbidden pattern: tab char (line 169)
forbidden pattern: tab char (line 227)
forbidden pattern: tab char (line 229)
forbidden pattern: tab char (line 228)
forbidden pattern: tab char (line 225)
forbidden pattern: tab char (line 167)
forbidden pattern: tab char (line 231)
FAIL koha-tmpl/opac-tmpl/prog/en/modules/opac-main.tt
FAIL forbidden patterns
forbidden pattern: tab char (line 25)
7) It would be great to pass a hashref to get_opac_news
Marked as Failed QA.
--
You are receiving this mail because:
You are watching all bug changes.
More information about the Koha-bugs
mailing list