Repository navigation
Do not keep answers for fields hidden by logic - #68
Open
juanlentino wants to merge 2 commits into
Open
juanlentino wants to merge 2 commits into
juanlentino wants to merge 2 commits into
Conversation
Validation already skips a field that logic hides, but its posted value was still stored, and confirmation, notification and action rules read the stored values. The value is now emptied after spam screening (so alltfo_spam_verdict still sees what was posted) and before the entry is stored and the rules run, which is what the alltfo_visible_fields() docblock already promised. Engineered with Claude as a pair programmer. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
juanlentino
marked this pull request as ready for review
October 10, 2026 20:34
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #67.
Validation already skips a field that logic hides, but the field's posted value was still stored, and confirmation, notification and action rules read the stored values. This empties a hidden field's value after spam screening and before the entry is stored and the rules run. That is what the
alltfo_visible_fields()docblock already says happens.What changes
includes/submission.php:alltfo_drop_hidden_values( $schema, $values )runs right afteralltfo_screen_for_spam().alltfo_sanitize_field_value( '', $field ), the same shape as an unanswered field.filefield's uploads are deleted, the same way a refused submission's are.alltfo_spam_verdictcallbacks are unaffected.assets/jsbundles are untouched.Tests (
tests/phpunit/tests/hiddenValues.php)hiddentype field with no logic keeps its value.alltfo_spam_verdictcallback still sees the posted value.submit-formability gets the same result.Tests ran in CI here: PHPUnit 806 tests, all passing (801 on
main, plus these 5). I could not run them locally (no Docker on this machine). phpcs passes on the changed files. A no-JS browser is not exercised in a test; the request it sends is what the first test posts.Possible behavior change for sites: a site that relied on a hidden field's value being stored (for example a pre-filled field behind logic) would see it empty. A field with no logic, including the
hiddentype, is unaffected.The readme changelog is left to you, as on earlier contributor PRs.
Engineered with Claude as a pair programmer.