Skip to content

FOUR-23857: When I add a pmblock configured with a collection in select list, errors are shown in the modeler #458

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 11, 2025

Conversation

eiresendez
Copy link
Contributor

@eiresendez eiresendez commented Jul 9, 2025

Issue

When using a Select List with a collection as the data source, if any collection record contains null in the labelField or valueField, the application crashes with:

TypeError: right-hand side of 'in' should be an object, got null

This happened in formatCollectionRecordResults, which was attempting to use the in operator on a potentially null value.

Solution

  • Added null-checks to ensure content and value are valid objects before using the in operator.
  • Used String(value ?? '') to gracefully handle undefined/null values.

How to Test

  1. Create or use a Collection where some fields in labelField or valueField are null.
  2. Bind a Select List component to that collection.
  3. Load the form/screen and confirm that:
  • The Select List loads without crashing.
  • Entries with null values show as empty strings instead of throwing errors.
  1. Also test a “normal” case where records have expected structure (e.g. value.id and content.name) to ensure no regressions.

Ticket

.

Ensure content and value are valid objects before using the 'in' operator in formatCollectionRecordResults. This avoids runtime errors when collection records contain null values.
@eiresendez eiresendez requested a review from sanjacornelius July 9, 2025 15:55
@vladyrichter
Copy link

QA server K8S was successfully deployed https://ci-e6a33f121c.engk8s.processmaker.net

@vladyrichter
Copy link

QA server K8S was successfully deployed https://ci-e6a33f121c.engk8s.processmaker.net

Copy link

Quality Gate passed Quality Gate passed

Issues
0 New issues
0 Fixed issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarQube

@nolanpro nolanpro merged commit 1395adb into develop Jul 11, 2025
14 of 23 checks passed
@nolanpro nolanpro deleted the bugfix/FOUR-23857 branch July 11, 2025 19:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants