Skip to content

Plain words in rule errors and the submit API docs - #278

Merged
PhilReinking merged 7 commits into
mainfrom
fix/bits-287-server-words
Oct 13, 2026
Merged

PhilReinking merged 7 commits into
mainfrom
fix/bits-287-server-words

Conversation

@PhilReinking

@PhilReinking PhilReinking commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

The rule errors the editor shows now use the editor's words ("question", "rule", "condition") instead of field names like "source block" or "evaluate". The API docs for submitting a form no longer say "multiple choice".

Part of BITS-287

Tested: full PHP suite on MariaDB, and in CI after the main merge. The new test lines fail with the old texts.

🤖 Generated with Claude Code

PhilReinking and others added 3 commits October 13, 2026 03:41
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@PhilReinking PhilReinking left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK at a781985, CI green. Two shoulds inline.

The new test fails with main's messages, and "condition 1" is the first condition, as the editor numbers them. The other messages match the editor: question, comparison, and/or, hide/show/go to. The API docs still build with Scribe.

Comment on lines +26 to +30
For single choice, checkbox and consent questions, the payload is an array of payload-objects.
DESC, example: [
'7j' => ['payload' => 'Secret', 'actionId' => '59R'],
'4x1' => ['payload' => 'mail@example.com', 'actionId' => 'pQ6'],
// For multiple choice questions, the payload is an array of the selected options
// For single choice and checkbox questions, the payload is an array of the selected choices

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should: single choice sends one payload-object, not a list. The public form uses setResponse for single choice and toggleResponse (a list) only for checkbox and consent (ButtonAction.vue:150, ConsentAction.vue:68). The server takes both shapes, so nothing breaks, but the docs say otherwise, and two picks in the example fit only checkboxes.

Suggested change
For single choice, checkbox and consent questions, the payload is an array of payload-objects.
DESC, example: [
'7j' => ['payload' => 'Secret', 'actionId' => '59R'],
'4x1' => ['payload' => 'mail@example.com', 'actionId' => 'pQ6'],
// For multiple choice questions, the payload is an array of the selected options
// For single choice and checkbox questions, the payload is an array of the selected choices
For checkbox and consent questions, the payload is an array of payload-objects, one for each ticked choice or policy. A single choice question sends one payload-object for the picked choice.
DESC, example: [
'7j' => ['payload' => 'Secret', 'actionId' => '59R'],
'4x1' => ['payload' => 'mail@example.com', 'actionId' => 'pQ6'],
// For checkbox questions, the payload is an array of the ticked choices

'name.required' => 'Give the rule a name.',
'conditions.required' => 'Add at least one condition.',
'conditions.*.source.required' => 'Pick a question for condition :position.',
'conditions.*.value.required' => 'Enter a value for condition :position.',

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should: the wording table renames this field from "Enter a value" to "Pick an answer" (choices) and "Answer" (text). The rule editor in #274 labels it "Answer for condition 1" and sends an empty answer to the server, so this message shows next to that field. Test line 123 changes with it (I ran it: 9 of 9 pass).

Suggested change
'conditions.*.value.required' => 'Enter a value for condition :position.',
'conditions.*.value.required' => 'Add an answer for condition :position.',

PhilReinking and others added 2 commits October 13, 2026 09:14
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@PhilReinking PhilReinking left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK at 0aa6a12, CI green.

Both shoulds are fixed as suggested, and nothing else changed since a781985. The docs now say only checkbox and consent questions send a list, which matches the public form, and the condition message asks for an answer.

PhilReinking and others added 2 commits October 13, 2026 12:40
…ords

# Conflicts:
#	CHANGELOG.md
#	tests/Feature/FormBlockLogicTest.php
The check from #264 still said "The question of your #1 condition
is not in this form." Now it reads like the other rule messages.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@PhilReinking PhilReinking left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK at 8b02c1a, CI green. The merge of main changes only CHANGELOG.md and the test order in FormBlockLogicTest.php by hand; both sides stay whole. The PR's own diff against main is the reviewed one from 0aa6a12 plus 8b02c1a. The new message fits the rule: it fails for a question that was deleted or is in another form, and the test checks the full text.

@PhilReinking
PhilReinking merged commit a079008 into main Oct 13, 2026
6 checks passed
@PhilReinking
PhilReinking deleted the fix/bits-287-server-words branch October 13, 2026 12:47
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.

1 participant