I have a rather general question about plugins and resources.
in response to the modx event "OnBeforeDocFormSave" I can use
$resource->set('attrname', 'value');
but setting tv values won't work. (why?)
On the other hand, in response to the modx event "OnDocFormSave" I can use
$resource->setTVValue('tvname', 'value');
but setting any resource attributes won't work.
could anyone explain, why that is the case. or how it is done better?
I want i.e. read a resource attribute, change a tv according to the contents of the attribute value, and change the attribute value itself at last.
At the moment I am working with revo 2.3.3-pl. But I guess this is no version specific bug.
Edit: Some more forum posts like the ones below that scratch the topic but I couldn't find a description how to do stuff like validation and autocorrections in the manager for resources via plugins. Any hints welcome.
https://forums.modx.com/forums/thread/71048/setting-tv-value-via-plugin#dis-post-396921
https://forums.modx.com/forums/thread/37615/solved-set-templatevariable-value-for-a-resource#dis-post-213146
thank you in advance,
~d
[ed. note: domindian last edited this post 11 years, 3 months ago.]