Commit 4a3ad64d authored by Chris Graham's avatar Chris Graham
Browse files

Fixed MANTIS-4686 (Error message on disabled template preview hooks)

parent 353fa4de
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -902,9 +902,17 @@ function render_screen_preview($template, $hook, $function)
        $text = false;
    }

    if (!method_exists($ob, $function)) {
        fatal_exit(do_lang_tempcode('MISSING_RESOURCE'));
    }

    // Render preview
    $previews = call_user_func(array($ob, $function));

    if (!array_key_exists(0, $previews)) {
        warn_exit(do_lang_tempcode('NO_ENTRIES'));
    }

    if ($text) {
        $previews[0] = with_whitespace($previews[0]);
    }