Skip to content

fix: preserve job order regarding when editing#704

Merged
RussH merged 3 commits intoopencats:masterfrom
anonymoususer72041:fix/activity-regarding
Apr 14, 2026
Merged

fix: preserve job order regarding when editing#704
RussH merged 3 commits intoopencats:masterfrom
anonymoususer72041:fix/activity-regarding

Conversation

@anonymoususer72041
Copy link
Copy Markdown
Contributor

This PR fixes an issue where editing an Activity could unintentionally reset the "Regarding" field from a specific Job Order to "General". The root cause was fragile preselection logic in the edit UI that relied on comparing rendered text, which could fail (for example when the dropdown option text includes markers like (*)).

The edit modal now preselects the correct Job Order using the underlying jobOrderID rather than display text. In addition, saving "General" is normalized so that activity.joborder_id is persisted as SQL NULL instead of inconsistent sentinel values created by legacy paths (such as 0 or -1).

Finally, the PR includes a schema migration that updates existing rows and converts legacy activity.joborder_id values of 0 and -1 to NULL, ensuring "General" is represented consistently across old and new data.

@anonymoususer72041 anonymoususer72041 changed the title fix(activity): preserve job order regarding when editing fix: preserve job order regarding when editing Feb 17, 2026
@anonymoususer72041 anonymoususer72041 force-pushed the fix/activity-regarding branch 3 times, most recently from 2093dfa to f3bf3fc Compare March 31, 2026 11:50
@RussH
Copy link
Copy Markdown
Member

RussH commented Apr 8, 2026

@anonymoususer72041 Can you fix this so it's not breaking the CI tests? Can't Merge until then of course.

@anonymoususer72041
Copy link
Copy Markdown
Contributor Author

@RussH I fixed the problem in modules/install/Schema.php and also adjusted missing changes in modules/companies/Show.tpl.

Unfortunately testing is currently not possible due to issue #735, so I will mark this PR as draft for now.

@anonymoususer72041 anonymoususer72041 marked this pull request as draft April 8, 2026 16:27
@anonymoususer72041 anonymoususer72041 marked this pull request as ready for review April 9, 2026 10:33
@anonymoususer72041
Copy link
Copy Markdown
Contributor Author

anonymoususer72041 commented Apr 9, 2026

After #735 was solved, I was able to successfully complete the testing, so I'm marking this PR as ready to review again.

@RussH
Copy link
Copy Markdown
Member

RussH commented Apr 14, 2026

Thank you for the PR - tested and merging.

@RussH RussH merged commit ee91f81 into opencats:master Apr 14, 2026
3 checks passed
@anonymoususer72041 anonymoususer72041 deleted the fix/activity-regarding branch April 14, 2026 17:44
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.

3 participants