The following code is a small part of a module I've written for a client project. Can anyone see why in some templates it outputs the newrelic code but in others it doesn't?

function newrelic_stop() 
// Set defaults
$output = "";

if (extension_loaded('newrelic'))
    $output = newrelic_get_browser_timing_footer();

// Show the output
return $output;
  • Maybe you need to post the rest of the code...?
    – Timo002
    Mar 18 '14 at 0:54

So it turns out that if I use an embed to output my opening newrelic code (method called newrelic_start in my addon), that outputs fine but stops the newrelic_stop tag from returning anything at all.

The fix: Use a stash embed instead! Doing this is not only a performance benefit over a traditional embed, but also gets my closing newrelic tag returning what it should.

Note that in the stash embed, you need to use process="inline"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.