Fix taxonomy term ID parsing in surveillance threshold sanitizer#424
Conversation
0504098
into
codex/fix-redeclaration-of-blc_sanitize_surveillance_thresholds_op
There was a problem hiding this comment.
💡 Codex Review
WP-liens-morts-detector/liens-morts-detector-jlg/includes/blc-settings-fields.php
Lines 4778 to 4813 in 3bb77b9
The new sanitizer always parses term_ids even when the user selected “apply to all”. blc_normalize_surveillance_threshold_group later recomputes apply_to_all_terms purely from whether term_ids is empty. If a saved taxonomy threshold previously targeted specific terms and the user switches the checkbox to apply to all without manually clearing the textarea, the sanitized payload will still carry the old term_ids array and normalization will flip the flag back to false. The user therefore cannot change an existing threshold to apply to all terms unless they also clear the term IDs field, which the UI may hide. Consider clearing term_ids when $apply_to_all is true before handing off to the normalizer.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Summary
Testing
https://chatgpt.com/codex/tasks/task_e_68f3f91f5f38832e812814ffb86e6b57