Problem/Motivation

On the Manage display page of custom entity types, a number or PHP notices and warning are displayed. On the same page the usual Entity Print fields (View Word Document, View EPub, View PDF) are absent. The latter is probably the cause of these notices/warnings.

Notice: Undefined index: #value in Drupal\field_ui\Element\FieldUiTable->tablePreRender() (line 62 of core/modules/field_ui/src/Element/FieldUiTable.php).
Notice: Undefined index: #region_callback in Drupal\field_ui\Element\FieldUiTable->tablePreRender() (line 70 of core/modules/field_ui/src/Element/FieldUiTable.php).
Warning: call_user_func() expects parameter 1 to be a valid callback, no array or string given in Drupal\field_ui\Element\FieldUiTable->tablePreRender() (line 70 of core/modules/field_ui/src/Element/FieldUiTable.php).
Notice: Undefined index: weight in Drupal\field_ui\Element\FieldUiTable->tablePreRender() (line 77 of core/modules/field_ui/src/Element/FieldUiTable.php).

To reproduce:
- Create a custom entity type with drupal console generate:entity:content
- Go to the Manage display page of the entity type

Proposed resolution

Remaining tasks

CommentFileSizeAuthor
#7 2822099-7.patch2.43 KBbenjy
#2 2822099-2.patch1.5 KBbenjy
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Sutharsan created an issue. See original summary.

benjy’s picture

Status: Active » Needs review
FileSize
1.5 KB

Ahh, I broke that recently, it doesn't work for content entities without a bundle. Try the attached patch, just needs a test.

Status: Needs review » Needs work

The last submitted patch, 2: 2822099-2.patch, failed testing.

The last submitted patch, 2: 2822099-2.patch, failed testing.

benjy’s picture

Status: Needs work » Needs review

Patch passes against 8.2 but fails against 8.3, interesting.

benjy’s picture

OK, fails are fixed in HEAD, this is green against both branches now. We just need a new test and I can commit this.

benjy’s picture

FileSize
2.43 KB

With a test.

benjy’s picture

Status: Needs review » Fixed

Committed and pushed.

  • benjy committed 25cd416 on 8.x-2.x
    Issue #2822099 by benjy, Sutharsan: PHP notices/warnings on Manage...
Sutharsan’s picture

Thanks for the fast response. Code makes sense, patch fixes the problem.

Status: Fixed » Closed (fixed)

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

ExTexan’s picture

This patch seems to be against 2.x-dev. I'm getting these errors on v1.3. I tend to stay away from dev versions, preferring the more stable releases. Is there a patch for these errors for v1.x?

benjy’s picture

No but if you want to open a new issue and try and backport the patch, i'll happily commit it. The 2.x branch is nearing stability though, I've already tagged a beta.