Has anyone managed to sync a #MIGX TV (little image gallery) with Babel ?
From the Babel Doc :
IDs of TVs to be synchronized (babel.syncTvs): Comma separated list of ids of template variables (TVs) which should be synchronized by Babel.
Is the TV ID i see in the tree manager not the right one to use ?
CTRL+SHIFT+U - Clear Cache
CTRL+SHIFT+H - Hiding Heft Panel
CTRL+SHIFT+N - Fast Create Resource
CTRL+ALT+P - Preview Recource (in edit resorce window)
CTRL+ALT+S - Save
Is the TV ID i see in the tree manager not the right one to use ?
the ID, which you see in the elements-tree should be the right one to use for the syncTvs - list.
reading the code, babel should synchronize this TVs on the event onDocFormSave within the function sychronizeTvs
https://github.com/mikrobi/babel/blob/master/core/components/babel/model/babel/babel.class.php#L127
Ok, so i try to log the tv value like this in the foreach loop :
$this->modx->log(modX::LOG_LEVEL_ERROR, '## TV value: '.$tvValue);
and i get this :
[2013-12-17 10:50:56] (ERROR @ /connectors/resource/index.php) ## TV value: []
?!
i'm on MODX Revolution 2.2.10-pl (traditional)
CTRL+SHIFT+U - Clear Cache
CTRL+SHIFT+H - Hiding Heft Panel
CTRL+SHIFT+N - Fast Create Resource
CTRL+ALT+P - Preview Recource (in edit resorce window)
CTRL+ALT+S - Save
discuss.answer
[] <- this looks like an empty MIGX-TV, isn't it empty?
Quote from: Bruno17 at Dec 17, 2013, 04:35 AM[] <- this looks like an empty MIGX-TV, isn't it empty?
Well no ! If i output my MIGX TV in a template [[*myMIGXTV]] i see there is some value in it
[{"MIGX_id":"1","title":"hy\u00e8ne sauvages","description":"la chasse est ouverte","image":"spectacletest\/DSC00783.JPG"},{"MIGX_id":"2","title":"Autruches","description":"D\u00e9bat d'id\u00e9es","image":"spectacletest\/DSC00792.JPG"},{"MIGX_id":"3","title":"","description":"","image":"spectacletest\/DSC00783.JPG"},{"MIGX_id":"4","title":"aaaa","description":"","image":"spectacletest\/DSC00792.JPG"},{"MIGX_id":"5","title":"","description":"","image":"spectacletest\/DSC00783.JPG"}]
I'm not a PHP master but there should be something in the babel fonction who escape {..} and prevent syncronizing MIGX JSON.
CTRL+SHIFT+U - Clear Cache
CTRL+SHIFT+H - Hiding Heft Panel
CTRL+SHIFT+N - Fast Create Resource
CTRL+ALT+P - Preview Recource (in edit resorce window)
CTRL+ALT+S - Save
does it have the correct resourceid?
$this->modx->log(modX::LOG_LEVEL_ERROR, '## TV value: '.$resourceId.':'.$tvValue);
Quote from: Bruno17 at Dec 17, 2013, 06:18 AMdoes it have the correct resourceid?
$this->modx->log(modX::LOG_LEVEL_ERROR, '## TV value: '.$resourceId.':'.$tvValue);
Yes it's the correct resourceId :
[2013-12-17 14:37:38] (ERROR @ /connectors/resource/index.php) ## tvValue: []
[2013-12-17 14:37:38] (ERROR @ /connectors/resource/index.php) ## resourceId: 1103
CTRL+SHIFT+U - Clear Cache
CTRL+SHIFT+H - Hiding Heft Panel
CTRL+SHIFT+N - Fast Create Resource
CTRL+ALT+P - Preview Recource (in edit resorce window)
CTRL+ALT+S - Save
...
ok, you were right... while rechecking all settings i found a little error in my syncTV settings.. id 97 instead of 87...
Thank you for your help Bruno !
CTRL+SHIFT+U - Clear Cache
CTRL+SHIFT+H - Hiding Heft Panel
CTRL+SHIFT+N - Fast Create Resource
CTRL+ALT+P - Preview Recource (in edit resorce window)
CTRL+ALT+S - Save