modxbot / migrate

A testground for migrating issues and other such fun
0 stars 0 forks source link

$user->getSettings() returns empty array #5257

Open wshawn opened 13 years ago

wshawn commented 13 years ago

wshawn created Redmine issue ID 5257

This doesn't work:

print_r($user->getSettings);

These do:

    $uss = $user->getMany('UserSettings');
        foreach ($uss as $us) {
            $settings[$us->get('key')] = $us->get('value');
        }
    print_r($settings);

The previous was simply the function pulled directly from the class.

    $uid = $user->get('id');
    $u = $modx->getObjectGraph('modUserSetting', '{"User":{}}', $uid, true);
    print_r($u->toArray());

I also noticed the modx.class.php has it's own "subroutine" to pull the settings instead of using the one in modx.user.class.php.

wshawn commented 13 years ago

wshawn submitted:

typo:

print_r($user->getSettings());

Works if called with ().

Was sure I had done that.... weird.

Still don't understand why modx.class has its own "version" of this.

wshawn commented 13 years ago

wshawn submitted:

Works correctly in 2.1.2 but doesn't in 2.1.1