We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 28840
    • 46 Posts
    Ok, I'm having a problem - I have a one-line-list TV with template IDs. In my plugin which fires on OnDocFormRender I get it with:
    $parent = $modx->getObject('modResource',$id);
    $ct = $parent->getTVValue('templateTV');
    if (isset($modx->controller)) {
      $modx->controller->setProperty('template', $ct);
    } else { // modX < 2.2.0
      $_REQUEST['template'] = $ct;
    }
    

    and because of the second line
    $ct = $parent->getTVValue('templateTV');

    the gallery OnTVOutputRenderList somehow fires and outputs a path (in screenshot). I can comment out the if part but the problem is still there.

    I checked the getTVValue function and it calls the OnTVOutputRenderList event. What am I missing?

    Sumoborac
      • 28840
      • 46 Posts
      Well I did a hard-fix-workaround. In my plugin I added the "OnTVOutputRenderList" on System event list and added this piece of code:

      if($modx->event->name == 'OnTVOutputRenderList'){
      	$modx->event->output(''); //Gallery fix i hope? :/
      }

      And the path is gone. But I have no idea if this will have any deeper impact somewhere else :/

      Sumoborac