Skip to content

Commit

Permalink
fix(Users) return correct set of fields in webservice after profile c…
Browse files Browse the repository at this point in the history
…hange
  • Loading branch information
joebordes committed Aug 7, 2022
1 parent 0b12404 commit fee5f75
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion include/Webservices/Retrieve.php
Expand Up @@ -60,7 +60,7 @@ function vtws_retrieve($id, $user) {
$listofrelfields[] = $entity[$relfield];
}
}
if ($entityName=='Users') {
if ($entityName=='Users' && !empty($entity['roleid'])) {
$entity['rolename'] = getRoleName($entity['roleid']);
}
if (!empty($listofrelfields)) {
Expand Down
2 changes: 1 addition & 1 deletion include/Webservices/VtigerCRMObjectMeta.php
Expand Up @@ -392,7 +392,7 @@ private function retrieveMetaForBlock($block) {
if ($userprivs->hasGlobalReadPermission() || $this->objectName == 'Users') {
$pf = $adb->pquery('select profileid from vtiger_role2profile where roleid=? limit 1', [$this->user->column_fields['roleid']]);
$profileForSummary = ($pf ? $pf->fields['profileid'] : 0);
if (empty($profileForSummary)) {
if (empty($profileForSummary) || $this->objectName == 'Users') {
$sql = "SELECT vtiger_field.*, '0' as readonly, vtiger_blocks.sequence as blkseq
FROM vtiger_field
LEFT JOIN vtiger_blocks ON vtiger_field.block=vtiger_blocks.blockid
Expand Down

0 comments on commit fee5f75

Please sign in to comment.