Skip to content

Comments

Forms 1.0.15: Fix null value handling and form submission error detection#725

Merged
dwertheimer merged 2 commits intomainfrom
fix/null-handling-and-form-submission-errors
Jan 19, 2026
Merged

Forms 1.0.15: Fix null value handling and form submission error detection#725
dwertheimer merged 2 commits intomainfrom
fix/null-handling-and-form-submission-errors

Conversation

@dwertheimer
Copy link
Collaborator

Summary

This PR fixes critical issues with null value handling and form submission error detection.

Changes

Fixed

  • CRITICAL: Null Value Handling: Fixed TypeError: null is not an object (evaluating 'Object.getOwnPropertyNames') error that occurred when templating plugin tried to process form data containing null values. Added explicit null checks in JSP, getFilteredProps, and getAllPropertyNames helper functions.
  • Form Submission Success Detection: Fixed issue where successful form submissions were incorrectly flagged as errors. When templateRunner successfully creates a note, it returns undefined (which is valid), but the code was treating this as an error.
  • Deep Null Sanitization: Added comprehensive deep sanitization of null/undefined values throughout form data processing.
  • setTimeout Removal: Removed setTimeout usage (not available in NotePlan's JSContext).

Changed

  • templateNew Return Value: Updated to return filename (string) on success or null on failure for API consistency.
  • templateRunner Return Value: Updated to return filename when note is successfully created.
  • Error Messages: Improved to be more specific about null value issues.

Testing

  • Form submissions now work correctly with unset fields
  • No more false error messages on successful submissions
  • Null values are properly sanitized throughout the data flow

Version

Bumped to 1.0.15

- Fixed critical null value handling in JSP/getFilteredProps/getAllPropertyNames
  functions to prevent 'TypeError: null is not an object' errors
- Fixed form submission success detection - undefined is now treated as success
  when templateRunner creates a note (was incorrectly flagged as error)
- Added deep null sanitization throughout form data processing
- Made templateNew return filename for API consistency
- Updated templateRunner to return filename on successful note creation
- Removed setTimeout usage (not available in NotePlan JSContext)
- Improved error messages for better debugging

Version bump to 1.0.15
… error handling

- Moved getFolders, getNotes, getEvents, getHashtags, getMentions, getTeamspaces
  from requestHandlers.js to new dataHandlers.js to break circular dependencies
- Moved RequestResponse type to shared/types.js for better type sharing
- Improved error handling in FormBrowserView for form submission responses
- Updated imports across affected files
@dwertheimer dwertheimer changed the title Fix null value handling and form submission error detection Forms 1.0.15: Fix null value handling and form submission error detection Jan 19, 2026
@dwertheimer dwertheimer merged commit 62fcafc into main Jan 19, 2026
4 checks passed
@dwertheimer dwertheimer deleted the fix/null-handling-and-form-submission-errors branch January 19, 2026 04:26
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.

1 participant