I see this error when I am adding a new node on my site, and sometimes when editing. I think it may depend on the node field config and how workbench access understands that. I didn't look to far into it tbh but I think the attached patch is good since it covers the possibility that

$scheme->fields('node', $node->bundle());

might return empty.

CommentFileSizeAuthor
#2 2811445--empty-check-on-fields.patch706 bytesdpolant
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dpolant created an issue. See original summary.

dpolant’s picture

Here is a patch.

agentrickard’s picture

Status: Active » Reviewed & tested by the community

Makes sense. This would be a case where no field is configured.

I suspect we can wrap that whole block in:


if ($field = $scheme->fields('node', $node->bundle())) {
 ... do things ...
}
agentrickard’s picture

Status: Reviewed & tested by the community » Fixed

The code is easier to read as presented in the patch.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.