Skip to content

fix: resolve field types and languages by name, not by numeric id - #2142

Merged
renemadsen merged 2 commits into
stablefrom
fix/8141-shifted-lookup-ids
Oct 16, 2026
Merged

renemadsen merged 2 commits into
stablefrom
fix/8141-shifted-lookup-ids

Conversation

@renemadsen

Copy link
Copy Markdown
Member

SDK lookup ids are only contiguous by accident of AUTO_INCREMENT. On a
fresh install with auto_increment_increment=3 (Galera) Picture is 15 and
Danish is 3, so:

  • the report filtered pictures on FieldTypeId == 5 and showed/exported
    no images and ImagesCount 0;
  • the Excel planning import mapped the '|'-separated name segments to
    Languages Id 1..3 and threw "Sequence contains no elements".

Pictures are now selected by FieldType.Type and the import pairs the
name segments with da / en-US / de-DE by LanguageCode. Segments beyond
the third are ignored (previously they went to whatever language had
id 4+).

Adds Testcontainers tests that run the real SDK seeding with
--auto-increment-increment=3.

Refs microting/eform-angular-frontend#8141

Test plan

  • 12/12 tests (Testcontainers, --auto-increment-increment=3)

Known, out of scope (follow-ups)

  • Re-importing a planning never updates its name translations.

No seeder change and no data migration in this PR: existing installs keep their ids, the code just stops assuming them.

🤖 Generated with Claude Code

SDK lookup ids are only contiguous by accident of AUTO_INCREMENT. On a
fresh install with auto_increment_increment=3 (Galera) Picture is 15 and
Danish is 3, so:

- the report filtered pictures on FieldTypeId == 5 and showed/exported
  no images and ImagesCount 0;
- the Excel planning import mapped the '|'-separated name segments to
  Languages Id 1..3 and threw "Sequence contains no elements".

Pictures are now selected by FieldType.Type and the import pairs the
name segments with da / en-US / de-DE by LanguageCode. Segments beyond
the third are ignored (previously they went to whatever language had
id 4+).

Adds Testcontainers tests that run the real SDK seeding with
--auto-increment-increment=3.

Refs microting/eform-angular-frontend#8141

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The focused lookup changes have regression coverage and no identified blocking issues; tests were not executed during this review.

0 open findings

What changed in this PR

Removes assumptions about numeric SDK lookup IDs so reporting and planning imports work with noncontiguous IDs.

Changes:

  • Selects pictures by field type name.
  • Maps planning-name segments to language codes, ignoring segments beyond the third.
  • Adds container-based regression tests with shifted lookup IDs.
File Description
eFormAPI/​Plugins/​ItemsPlanning.Pn/​ItemsPlanning.Pn/​Services/​PlanningImportService/​PlanningImportService.cs Resolves translation language IDs by code.
eFormAPI/​Plugins/​ItemsPlanning.Pn/​ItemsPlanning.Pn/​Services/​ItemsPlanningReportService/​ItemsPlanningReportService.cs Filters pictures by type name for images and counts.
eFormAPI/​Plugins/​ItemsPlanning.Pn/​ItemsPlanning.Pn.Test/​ShiftedLookupIdsTests.cs Tests SDK seeding, reports, imports, and reimports with shifted IDs.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

…ests

Codacy blocks the PR on the duplicated arrange block; it moves into
ImportNewPlanning(). Both tests assert the same behaviour as before.

Refs microting/eform-angular-frontend#8141

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 15, 2026 15:10

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The focused fixes have matching regression coverage and no identified blocking issues; tests were not executed during this review.

0 open findings

🧠 Review effort: Balanced

@renemadsen
renemadsen merged commit f3430a6 into stable Oct 16, 2026
12 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants