Skip to content

[6.x] Fix validatable preparation lifecycle#18944

Open
riasvdv wants to merge 2 commits into
6.xfrom
feature/consistent-validatable-preparation
Open

[6.x] Fix validatable preparation lifecycle#18944
riasvdv wants to merge 2 commits into
6.xfrom
feature/consistent-validatable-preparation

Conversation

@riasvdv
Copy link
Copy Markdown
Contributor

@riasvdv riasvdv commented May 21, 2026

Description

Fixes two validation lifecycle gaps:

  • Validatable::prepareForValidation() is now called consistently from Craft ruleset validation, including element rulesets and custom rulesets that override their own preparation hook.
  • Plain Validatable classes using Validates without a configured ruleset now fall back to ComponentRules instead of failing when ruleset resolves to false, so their getRules() contract works as expected.

@riasvdv riasvdv requested a review from brandonkelly May 21, 2026 18:55
@riasvdv riasvdv marked this pull request as ready for review May 21, 2026 18:55
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