ContextAwarePluginTrait::validateContexts violations are missing paths

Created on 22 June 2020, almost 5 years ago
Updated 2 April 2025, 4 days ago

Problem/Motivation

When validating contexts using the ContextAwarePluginTrait you get back a list of violations. However, the violations do not have paths set on them, making them very unhelpful, and making reporting back any errors very unhelpful.

Steps to reproduce

With a context aware plugin, set a value that violates a constraint, then call $this->validateContexts(). You will get violations, but with no paths.

Proposed resolution

The @todo suggests using the Symfony Validator will resolve this:

    // @todo Implement the Symfony Validator component to let the validator
    //   traverse and set property paths accordingly.
    //   See https://www.drupal.org/project/drupal/issues/3153847.

Original report

The lingering @todo in ContextAwarePluginTrait::validateContexts was found without a corresponding issue while working on #2273381: Convert ContextAwarePluginBase to traits β†’ .

Creating a placeholder issue for this since I have no idea what the original problem or intent was; maybe someone can figure this out after the parent issue is resolved.

πŸ› Bug report
Status

Postponed

Version

11.0 πŸ”₯

Component

plugin system

Created by

πŸ‡ΊπŸ‡ΈUnited States clayfreeman Paragould, AR

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024