Skip to content

fix(checkout): commit JS validation fix for auto-generate-password forms #741

@superdav42

Description

@superdav42

Problem

After PR #737 (simple checkout form template) merged, inc/checkout/class-checkout.php has an uncommitted fix sitting on main.

The fix adds form_has_auto_generate_password() method and uses it in get_js_validation_rules() to strip password-related JS validation rules when the checkout form uses auto-generated passwords. Without this, the JS validator requires a password field that is never rendered, blocking form submission.

What to do

  1. Create a worktree from main
  2. Implement the fix: add form_has_auto_generate_password(): bool protected method that iterates form settings to detect password fields with auto_generate_password enabled
  3. In get_js_validation_rules(), call this method and unset($raw_rules['password'], $raw_rules['password_conf'], $raw_rules['valid_password']) when true
  4. Commit and open a PR

Branch feature/738-simple-checkout-followup-fixes on origin has a similar implementation for reference.

Acceptance Criteria

  • form_has_auto_generate_password() method exists in Checkout class
  • get_js_validation_rules() strips password rules when auto-generate is enabled
  • PR passes CI

aidevops.sh v3.5.718 plugin for OpenCode v1.3.0 with claude-sonnet-4-6 spent 6m and 11,460 tokens on this as a headless worker.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions