fields display as required when not required

Created on 21 February 2025, about 2 months ago

Problem/Motivation

I have been using required_by_role with version 2 of this module, without trouble. Today I tried installing required_by_content_moderation_state and in the process upgraded to version 3. I changed some fields over from being required by role to being required by a state subsequent to draft/new. However, when creating a new node in draft state, the fields still show the red asterisk indicating they are required, and the form cannot be submitted with those fields blank. I have cleared the cache and rebuilt permissions.

The first time this occurred, a log message was generated saying

TypeError: Drupal\required_api\Plugin\Required\RequiredDefault::isRequired(): Return value must be of type bool, array returned in Drupal\required_api\Plugin\Required\RequiredDefault->isRequired() (line 26 of /app/web/modules/contrib/required_api/src/Plugin/Required/RequiredDefault.php).

However, this error has not recurred with subsequent loads of the form, so it may have been cache related.

Steps to reproduce

Other than what I described above, unknown. I'll do some more experimenting, but I wanted to open a ticket so that if someone else is having the same problem, they can find this.

πŸ› Bug report
Status

Active

Version

3.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States BenStallings

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

Comments & Activities

Production build 0.71.5 2024