The constraint policy model is documented, but the enforcement layer added alongside it is not. The docs describe the policy plugin type, the Policies tab and the shipped policies, yet say nothing about where and when the policies are enforced, the operator override, or how the customer message is set and translated. This is the part operators most need to understand.

Proposed resolution

Extend docs/constraints.md with two sections.

  • Enforcement and overrides: the surfaces that check the policies (the opt-in webform submit gate, the operator validation task, the operator order-list confirm, and the automated workflow confirm which releases and notifies on a race), the single choke point (OrderConstraintManager::validate via confirmOrder and validateOrder), and the persistent skip_constraints override that a "Validate anyway" or "Confirm anyway" tick sets and every check honors.
  • The customer message: the plain-language plural-aware default translated through the module .po, and the optional per-policy custom message with @limit and @group placeholders, which on a resource type is configuration translated through the Config Translation UI (the settings are schema-typed, message as label) exactly like the resource type label.

Documentation only, no code change.

Issue fork yoyaku-3609611

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

mably created an issue. See original summary.

mably’s picture

Status: Active » Needs review

  • mably committed c1726f82 on 1.x
    task: #3609611 Document constraint policy enforcement, the operator...
mably’s picture

Status: Needs review » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

mably’s picture

Rebased MR !15 onto the current 1.x and refreshed docs/constraints.md to match the enforcement code as it stands now, which has moved on since this was filed.

In particular there is no longer a "Validate anyway" option or a separate operator validation task, so the refreshed documentation describes the actual flow:

  • A single validation point, OrderConstraintManager::validate(), wrapped by OrderManager::validateOrder() and confirmOrder() (the latter throws OrderConstraintViolationException).
  • Three enforcement points: the booking form submit gate (the webform handler's Enforce constraints option), the order confirm transition form (it lists violations and blocks confirm unless they are resolved or "Confirm anyway" is ticked), and the Orchestra workflow (the Confirm order action raises on a violation, the Order review interaction surfaces them).
  • The override: ticking "Confirm anyway" sets the persistent skip_constraints flag on the order, which validate() honors at every point from then on.
  • Messaging: each policy ships a plural-aware default translated through the module .po files, and a custom per-policy "Message shown to the booker" accepts @limit (and @group for the group policy) and is translated through the Config Translation UI.

Documentation-only change, CI green.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.