Skip to content

FIX: Normalize empty optional Number macros in calculated fields - #747

Open
eclipses80 wants to merge 1 commit into
Crocoblock:mainfrom
eclipses80:fix/empty-number-field-macros
Open

eclipses80 wants to merge 1 commit into
Crocoblock:mainfrom
eclipses80:fix/empty-number-field-macros

Conversation

@eclipses80

@eclipses80 eclipses80 commented Nov 4, 2026 •

Copy link
Copy Markdown

Summary

  • Treat empty or invalid macros from Number fields as 0.
  • Keep empty Text field macros empty.
  • Preserve custom and deprecated calculated-field hooks.

Closes #644.

Validation

  • npx eslint assets/src/frontend/calculated.field/input.js passed.
  • Focused production webpack build passed.
  • Browser runtime testing remains pending; no JavaScript test harness is configured.

Manual test

Import the supplied form export without its waste zero-assignment rule. With pcs=4, weight=250, and waste empty, confirm calculated results populate; verify empty Text-field behavior remains unchanged.

@eclipses80 eclipses80 changed the title Normalize empty optional Number macros in calculated fields FIX: Normalize empty optional Number macros in calculated fields Nov 4, 2026
@eclipses80
eclipses80 marked this pull request as ready for review November 4, 2026 18:55
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.

Empty optional number-field macros produce NaN in calculated-field formulas

1 participant