Skip to content

Fix: RecordFactory mapping logic not triggering for missing source keys #8936

@tobiu

Description

@tobiu

This task fixes a bug in Neo.data.RecordFactory where model fields using the mapping configuration are not populated if the field name itself is missing from the input data object.

The Issue

Currently, setRecordFields iterates over Object.entries(fields) (the input data). If a field like y2025 relies on a mapping years.2025, but y2025 is not in the input data, setRecordFields never processes it, and the mapping logic inside parseRecordValue is never triggered.

The Fix

Modify Neo.data.RecordFactory.assignDefaultValues to also handle mapped fields.

  • Iterate over the model's fields.
  • If a field has a mapping and the field key is missing in the data object:
    • Explicitly set data[fieldName] = undefined (or the default value).
  • This ensures that setRecordFields will visit the field, triggering parseRecordValue, which then correctly resolves the mapping from the source data.

Acceptance Criteria

  • Fields with mapping are correctly populated even if their key is missing in the source data.
  • The DevRank grid correctly displays data for the mapped yearly columns.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingcoreCore framework functionality

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions