Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If any content type does not have a workflow, the module gives an error #403

Open
gargsuchi opened this issue May 8, 2023 · 0 comments
Open

Comments

@gargsuchi
Copy link
Contributor

gargsuchi commented May 8, 2023

This line

$moderation_state = reset($form_state->getValue('moderation_state'));

assumes that the content type has a moderation state associated.
There might be some content types that do not have a workflow associated.
When we edit such content and try to save - we get this error:
TypeError: reset(): Argument #1 ($array) must be of type array, null given in reset() (line 456 of /app/docroot/modules/contrib/tide_core/tide_core.module)

This issue can be fixed by wrapping this in isset()

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

No branches or pull requests

1 participant