Skip to content

Suggestion for modification on how the sortKeys are selected in the sample queries in Mappings #187

@vharseko

Description

@vharseko

Discussed in #186

Originally posted by lombao June 4, 2026
Hi, I have a suggestion, in case is worth to consider

I've been having some annoying issues with one mapping , from user object into LDAP.
When I was trying to use either the "Sample Source" on the properties page or the "Single Record Reconciliation" on the behaviours page I was getting an "Internal Error", but nothing at all in the logs.

It tooks me a while to understand that the issue seems to be on the file

ui/admin/default/org/forgerock/openidm/ui/SingleRecordReconciliationView.js
( possibly )

In the code

        setupSearch: function setupSearch() {
            var autocompleteProps = _.pluck(this.data.mapping.properties, "source").slice(0, this.getNumRepresentativeProps());

            mappingUtils.setupSampleSearch($("#findSampleSource", this.$el), this.data.mapping, autocompleteProps, _.bind(function (item) {
                conf.globalData.testSyncSource = item;

The autocompleteProps wll end up empty if the first attribute of the mapping does not have a source !!!!

image

That will trigger very annoying internal error becaause when you try to do a Sample source the query will be

...managed.user?_sortKeys=&_pageSize=10&_queryFilter=........

This _sortKeys=& is the things that causes the internal error.
and I wonder that if instead the line

var autocompleteProps = _.pluck(this.data.mapping.properties, "source").slice(0, this.getNumRepresentativeProps());

Could a different line that searches the "first source" available, instead of the first attribute , which, could be without "Source" part.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions