We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 27500
    • 14 Posts
    Was there a change to the getTemplateVarOutput API in 0.9.5? I was using 0.9.1 with the following code in a TV, which calls the value of the current doc’s TVs and uses those values in a DB query. There’s no errors, but I have a duplicate of the original DB that matches many items on many docs, in 0.9.5 there are no matches on any documents.

    @EVAL
    $pagetitle=$modx->documentObject[’pagetitle’];
    $longtitle=$modx->documentObject[’longtitle’];
    $id=$modx->documentIdentifier;
    $tvnames=array(’MFG’,’MFG2’);
    $tvoutput=$modx->getTemplateVarOutput($tvnames, $id, 1);
    $MFG = $tvoutput[’MFG’];
    $MFG2 = $tvoutput[’MFG2’];
    return $modx->db->query("SELECT name FROM db_table WHERE (manufacturer LIKE ’$MFG’ OR manufacturer LIKE ’$MFG2’)");

    A couple posts touch on this topic and are probably how I figured this out originally (but are before 0.9.5 release?):
    http://modxcms.com/forums/index.php/topic,1781.0.html
    http://modxcms.com/forums/index.php/topic,4563.0.html
      • 25663 MODX Staff
      • 12,272 Posts
      Somewhere along the way, multiline @BINDINGs died (but should be fixed in the next release). Try putting it all on one line.
        Ryan Thrash, MODX Co-Founder
        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
        • 27500
        • 14 Posts
        Thanks! That was the issue. This was working in 0.9.2.2 too, so the change must have happened between there and 0.9.5