[Koha-bugs] [Bug 16607] Add quiet flag to builder sub in TestBuilder

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri Jun 10 21:03:07 CEST 2016


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

--- Comment #4 from Marcel de Rooy <m.de.rooy at rijksmuseum.nl> ---
(In reply to Jonathan Druart from comment #3)
Thx for looking into this.

> I don't think it's a good idea to hide these warnings.

I agree in general. But if you have a closer look, you will see that this is
only a one-time, non-recursive hide for one build call. (Generated recursive
build calls already are verbose again.)

> If they appear it means that the developer is doing something wrong. Giving
> him the ability not to think but just add a quiet flag is not helping him :)
> For instance, we should not specify the primary (or unique) key, but let
> TestBuilder generating it, don't you think?

A developer could of course misuse this flag. He can do much more bad things :)
This flag is intended to intelligently suppress one warning.
As example: 
    $builder->build( { source => 'Branch', value => { branchcode => 'CPL' },
quiet => 1 });
In this case the developer uses TestBuilder to INSERT IGNORE a CPL branch in
just one line. He knows that TestBuilder will not insert it if it is already
there and he does not want to see the warning. So he passes the quiet flag.
Normally, we do not specify primary keys in TestBuilder, but I would not like
to block this specific use.

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


More information about the Koha-bugs mailing list