]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 1195736 - intermittent internal error: "file error - nav_link: not found" (also...
authorDylan Hardison <dylan@mozilla.com>
Wed, 13 Apr 2016 14:46:30 +0000 (10:46 -0400)
committerDylan Hardison <dylan@mozilla.com>
Wed, 13 Apr 2016 14:46:30 +0000 (10:46 -0400)
Bugzilla.pm
Bugzilla/Error.pm
Bugzilla/Template.pm

index 021783a7547f972fcd3704ed4096ad823ba7f2c2..cba448112178cbe9f624be67a245429b56de6aec 100644 (file)
@@ -518,6 +518,9 @@ sub error_mode {
     if (defined $newval) {
         $class->request_cache->{error_mode} = $newval;
     }
+    if ($class->template->in_process) {
+        return ERROR_MODE_DIE;
+    }
     return $class->request_cache->{error_mode}
         || (i_am_cgi() ? ERROR_MODE_WEBPAGE : ERROR_MODE_DIE);
 }
index fa898fba4324c4c104c4be266eefe34814012d30..92774520110391567be9249e8253b66717374ec7 100644 (file)
@@ -99,8 +99,13 @@ sub _throw_error {
     # and calling $template->process over and over for those errors
     # is too slow. So instead, we just "die" with a dump of the arguments.
     if (Bugzilla->error_mode != ERROR_MODE_TEST) {
-        $template->process($name, $vars, \$message)
-          || ThrowTemplateError($template->error());
+        if (Bugzilla->template->in_process) {
+            $message = "error inside Bugzilla->template->process: $error";
+        }
+        else {
+            $template->process($name, $vars, \$message)
+              || ThrowTemplateError($template->error());
+        }
     }
 
     # Let's call the hook first, so that extensions can override
index 56ebd9c21399090a692b0d3ffe071aaeb53de1a3..5b3b045abc0f191e414ba6fdad213e1f85312fa2 100644 (file)
@@ -665,12 +665,15 @@ $Template::Stash::SCALAR_OPS->{ truncate } =
 
 ###############################################################################
 
+our $_in_process = 0;
+sub in_process { return $_in_process }
 sub process {
     my $self = shift;
     # All of this current_langs stuff allows template_inner to correctly
     # determine what-language Template object it should instantiate.
     my $current_langs = Bugzilla->request_cache->{template_current_lang} ||= [];
     unshift(@$current_langs, $self->context->{bz_language});
+    local $_in_process = 1;
     my $retval = $self->SUPER::process(@_);
     shift @$current_langs;
     return $retval;