Doesn't work for File fields

Created on 31 January 2018, about 7 years ago
Updated 6 December 2024, 4 months ago

If you try to set the requirements on a file field, you get a http 500 error and something like this in the logs:

PHP Fatal error: Call to a member function uuid() on null in /data/sites/rad8.tomy.com/core/lib/Drupal/Core/Field/EntityReferenceFieldItemList.php on line 126, referer: /admin/config/people/accounts/fields/user.user.field_nda

I'm using a field on a user entity.

💬 Support request
Status

Closed: outdated

Version

1.0

Component

Code

Created by

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.

  • 🇧🇪Belgium dieterholvoet Brussels

    I just tested this with the following versions and I cannot reproduce the issue:

    • drupal/core:11.0.9
    • drupal/required_api:dev-3.0.x
    • drupal/required_by_role:dev-2.0.x

    When saving the node as a user with a role for which the field isn't required, the field displays as required, but the node can be saved. The Required API module got a big refactor in the new major version, so that might be the reason. Feel free to re-open if you can still reproduce the issue with the latest version of the module.

Production build 0.71.5 2024