Two related fixes in api.asp: 1. CreatePCMachineRelationship now archives stale Controls relationships in BOTH directions (Equipment->PC and the legacy PC->Equipment shape some prod rows use), so a self-registering PC cannot leave a stale controller active alongside its new link. Previously only the Equipment->PC direction was archived, leaving reversed legacy rows dangling. 2. LogToFile now clears Err before returning. It runs under On Error Resume Next; a failed write (logs dir not writable, disk full) left Err set, and CreatePCMachineRelationship tests Err.Number right after a LogToFile call, so a logging failure was misread as fatal and silently aborted relationship creation. Verified live: with the fix, updateCompleteAsset creates the PC, archives the reversed legacy relationship, and links the new PC. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
119 KiB
119 KiB