Are you sure the setting doesn't exist? The create processor will balk if the setting exists.
I should have looked more closely at your code.
AFAIK, a System Setting has no 'fk' field or 'description' field (though I haven't looked at the processor, which might use those) and all of the keys and values should be in single quotes.
Also, you're creating a System Setting, not a User Setting.
Here is how I usually do it:
<?php
/* @var $setting modUserSetting */
/* @var $modx modX */
$userId = $modx->user->get('id'); // or $user->get('id') if it's in a plugin
$setting = $modx->getObject('modUserSetting', array('key' => 'tree_root_id', 'user => $userId));
if (empty ($setting)) {
$setting = $modx->newObject('modUserSetting');
$setting->fromArray(array(
'user' => $userId;
'key' => 'tree_root_id',
'value' => '13699',
'xtype' => 'textfield',
'namespace' => 'accountinfo',
'area' => 'accountinfo',
), '', true, true);
$setting->save();
} else {
$setting->set('value', '13699' );
$setting->save();
}
------------------------------------------------------------------------------------------
PLEASE, PLEASE specify the version of MODX you are using.
MODX info for everyone:
http://bobsguides.com/modx.html
[ed. note: BobRay last edited this post 14 years, 1 month ago.]