-
Notifications
You must be signed in to change notification settings - Fork 70
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
Content model documentation: on edit, fatal errors leading to white screen #16827
Comments
Could be fixed by changing to
|
Trying to get the definition of the field fails, because the call to Here is the difference between giving it the field type and the field name. Suggest grabbing the field name dynamically rather than hardcoding. The field name of "image" only exists on the "Media" entity. All other image fields would have some other name that would never be "image" because they follow entity field names that are field instance dependent and prefixed with "field_". |
Summary big picture issue: The current code in imageFieldWidgetProcess() is hunting for an image field on every single entity that that Drupal loads. However, inside that function, the assumption is made that it is only ever operating on a "media" entity and this assumption runs into trouble. There are two possible solutions depending on the intention of code.
|
Noting: checked in with Marcia and Erika on this re: whether Facilities should go ahead and put up a PR for the code change Steve identified, or would like to own the PR. Marcia ok'ed putting up a PR. I've moved the associated PR from draft, and tagged in code reviewers. Not sure if this'll move today as I know a couple of people are out on wellness / before the 3-day weekend, so if not, it'll go after the break. |
(Updating assignment / sprint to reflect PR owner.) |
PR was just approved by CMS team and I merged it. This could be closed. |
Describe the defect
On trying to edit or create a new content model document, I receive a white screen error
Looking at the recent log entries I see
The line of code was merged Jan 10 2024 as part of this alt text validation PR
The problem is the line of code
if (method_exists($fieldDefinition, 'id'))
assumes that $fieldDefinition is an object when sometimes it can be null.
To Reproduce
Steps to reproduce the behavior:
AC / Expected behavior
We should be able to add or edit things without fatal errors.
Additional context
This is surfacing on Content Model Document entities but there is nothing special about them related to image fields. They are just another fieldable entity like nodes, terms, and paragraphs so it is possible this error is happening other places too.
ACs
The text was updated successfully, but these errors were encountered: