modxcms/revolution — pull request #235 by Bruno17 (2011-11-30 07:20:08+00:00)
Title: add modElemnt->setSource for explicit setting the source before processing

Signed-off-by: Bruno Perner

Need to change the TV-id in MIGX before running $tv->getRender.
To get the correct media-source I have to set the media-source before changing the id and before running $tv->getRender

I could do:

//set default_media_source for this TV before changing the id
$mediasource = $tv->getSource($modx->resource->get('context_key'));
$modx->setOption('default_media_source',$mediasource->get('id'));

Not sure if it is a good idea to do it this way, so with this pull request it would be enough todo:

//get and set media_source for this TV before changing the id
$mediasource = $tv->getSource($modx->resource->get('context_key'));