EntityConstraintViolationListInterface::filterByFields documentation is opposite of actual functionality

Created on 4 December 2019, over 5 years ago
Updated 15 July 2025, about 5 hours ago

Problem/Motivation

The documentation for EntityConstraintViolationListInterface::filterByFields suggests that the result will include the given $field_names, but the opposite is actually the case. The specific part of the documentation that is wrong is:

The returned object just has violations attached to the provided fields.

Proposed resolution

Perhaps something like this would be better:

The returned object has violations attached to the provided fields removed.

Remaining tasks

Decide on wording and do!

User interface changes

None.

API changes

No change to behaviour, but fixes documentation that is the opposite. I assume this doesn't count as a BC change, as core code is using it correctly, despite the documentation actually being reversed? Either way, something should be done!

Data model changes

None.

Release notes snippet

๐Ÿ› Bug report
Status

Active

Version

11.0 ๐Ÿ”ฅ

Component

entity system

Created by

๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom andrewbelcher

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

Merge Requests

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