http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10277 --- Comment #6 from Kyle M Hall <kyle.m.hall@gmail.com> ---
- I'm pretty sure terminating (via confess) is not the right thing to do if the userenv isn't set up yet; in particular, this has the potential to break command-line scripts for no good reason.
Good point, switched the confess to a carp!
- Doing it via confess() without loading the Carp module is wrong regardless.
I've added a "use Carp" to C4::Context. I think this is the best way to do it, but the BEGIN block does some stuff with CGI::Carp. I don't believe it will cause problems, but I just wanted to point this out.
- A patch that introduces a new C4::Context method but never uses it is untestable. It should, at the very least, attempt to replace some of the opaque userenv flags tests, and ideally should aim to replace them all. In other words, if we're going to refactor this, let's refactor this all the way.
I totally agree! I had originally split this off from another patch that uses it, but I'm in total agreement. I've attached a followup that switches all known code for superlibrarian checks to use IsSuperLibrarian. -- You are receiving this mail because: You are watching all bug changes.