ExtJS: modx-combo-user doesn't render username but user ID instead when user is preselected #13267

Open
gadgetto opened this Issue Jan 27, 2017 · 3 comments

Projects

None yet

3 participants

@gadgetto
gadgetto commented Jan 27, 2017 edited

Summary

Using an extjs modx-combo-user and trying to preselect a user when combo is loaded doesn't render the username but it's ID instead.

Step to reproduce

{
    xtype: 'modx-combo-user'
    ,fieldLabel: _('resource_createdby')
    ,description: '<b>[[*createdby]]</b><br />'+_('resource_createdby_help')
    ,name: 'created_by'
    ,hiddenName: 'createdby'
    ,id: 'modx-resource-createdby'
    ,anchor: '100%'
    ,value: config.record.createdby || MODx.user.id
}

Observed behavior

Doesn't render the username of preselected user but it's ID instead.

Expected behavior

Should render username of the preselected user.

Environment

MODX version: 2.5.4-pl

Can be fixed by adding the following lines to:

https://github.com/modxcms/revolution/blob/2.x/core/model/modx/processors/security/user/getlist.class.php#L35

$id = $this->getProperty('id');
if (!empty($id)) {
    $c->where(array('id' => $id));
}
@gadgetto gadgetto changed the title from ExtJS: modx-combo-user doesn't render username (but user ID) instead when user is preselected to ExtJS: modx-combo-user doesn't render username but user ID instead when user is preselected Jan 27, 2017
@Jako
Collaborator
Jako commented Jan 30, 2017 edited

It looks like all (or most) modx-combo variants have this issue.

@Jako Jako added this to the v2.5.5 milestone Jan 30, 2017
@gadgetto

The template-combo works as expected.

@Jako
Collaborator
Jako commented Jan 31, 2017 edited

Yes, but it fetches the whole templates with limit:0 for some reason. Seems that the store is filtering the data for the pagination.

@Mark-H Mark-H modified the milestone: v2.5.5, v2.5.6 Feb 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment