Skip to content

fix: use NULL for missing calendar event job order references#768

Open
anonymoususer72041 wants to merge 2 commits into
opencats:masterfrom
anonymoususer72041:fix/calendar-event-null-joborder
Open

fix: use NULL for missing calendar event job order references#768
anonymoususer72041 wants to merge 2 commits into
opencats:masterfrom
anonymoususer72041:fix/calendar-event-null-joborder

Conversation

@anonymoususer72041
Copy link
Copy Markdown
Contributor

PR #704 changed optional activity job order references to use NULL instead of the legacy -1 sentinel. Calendar events have the same optional job order relationship, but calendar_event.joborder_id still used -1 for missing job order references.

This updates calendar_event.joborder_id so missing job order references are represented as NULL consistently. The base schema now allows NULL and defaults to NULL and the update migration converts existing -1 values as well as orphaned non-NULL job order references to NULL.

The runtime write paths were updated accordingly. Calendar event creation and updates now pass PHP null when no job order is associated, and Calendar::addEvent() / Calendar::updateEvent() write SQL NULL for that case. Deleting a job order now clears related calendar event job order references by setting them to NULL.

The scope is intentionally limited to calendar_event.joborder_id. Other legacy -1 sentinels, such as calendar_event.data_item_id, calendar_event.data_item_type, activity input sentinels, and filter parameters where -1 has a different meaning, are left unchanged.

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