[Koha-bugs] [Bug 24745] OPAC news block plugin should evaluate as false if there are no items
bugzilla-daemon at bugs.koha-community.org
bugzilla-daemon at bugs.koha-community.org
Mon Mar 9 08:39:02 CET 2020
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24745
--- Comment #8 from Marcel de Rooy <m.de.rooy at rijksmuseum.nl> ---
(In reply to Owen Leonard from comment #7)
> (In reply to Marcel de Rooy from comment #6)
> > Wouldnt it be better to return undef or empty string in case of template use?
> > If it is concatenated somewhere, we get a 0 in between ?
>
> Returning undef triggered this error in the QA tool:
>
> "# Subroutines::ProhibitExplicitReturnUndef: Got 1 violation(s)."
This has to do with syntax. You should not write "return undef" but you write
"return;". In scalar context you return undef, in list context empty list.
--
You are receiving this mail because:
You are watching all bug changes.
More information about the Koha-bugs
mailing list