mirror of
https://github.com/ZoneMinder/zoneminder.git
synced 2026-10-12 11:43:13 -04:00
Controls.Type looks like the monitor type a control applies to, and has been kept in step with the Monitors enum since 1.27, but nothing has ever read it. The control dropdown on the monitor page lists every row by Name, no query filters on it, and no code compares it to the monitor's own Type. It was a field the edit form asked for and the control list displayed back. The column appears to be MonitorPresets.Type copied by analogy, where the idea is real: that one decides what a preset creates. That also explains why every migration altering one altered the other. Removes the column from the schema, adds the 1.39.39 migration, the edit form row and its type list, the control list column, the defaults in Control.php and Control.pm, and the value from all 53 shipped rows in controls.sql. This supersedes the 1.39.38 retyping of three libvlc controls to Ffmpeg: the column they were being retyped into is gone. zmcamtool needs no change -- its import regex rewrites the Id and captures the Name, so it is not positional past that, and its export is a mysqldump that follows the live schema. Dropping Type left the two shipped Pelco rows byte-identical to their twins, which existed only as a Local and an Ffmpeg copy of the same control, so the redundant copies are removed: 53 shipped rows become 51, with both Pelco-D and Pelco-P still present once. Existing installs are deliberately left with their duplicates. The same pair collapses there too, but deleting rows a monitor's ControlId may point at, to tidy a repeated name in a dropdown, is not a trade a migration should make silently. Verified by loading the old and rewritten controls.sql into scratch databases and diffing every remaining column across all 53 rows: no value shifted, which is the failure mode when a positional INSERT loses a field. The file mixes positional and explicit-column INSERTs, so both forms were handled. Fresh-install and migrated Controls schemas compare equal, the shipped data loads into both, and Monitors and MonitorPresets keep their Type. Build clean, 147 test cases pass, php -l and perl -c clean on the edited files. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015Y6FieTwEXuLhhR4e2yiax