I want to make some connection between the TV and the document variables - to change the docvars right before saving the document using the TVs.
But I can’t get the TVs available in the event [tt]OnBeforeDocFormSave[/tt], where I can change the docvars.
OnBeforeDocFormSave:
<?php
global $tmplvars;
print_r ($tmplvars);
$modx->messageQuit('Debug stopping');
This plugin gives me [tt]Array ( )[/tt] as a [tt]print_r[/tt] result.
That means that [tt]$tmplvars[/tt] is already defined as Array, which happens in [tt]save_content.processor.php #130[/tt], but has no elements inside, though they are perfectly collected in lines 173-181. And calls to OnBeforeDocFormSave happen only at #235 for the new document and #416 for the updated.
Where do the contents of [tt]$tmplvars[/tt] disappear?