Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment | File | Size | Author |
---|---|---|---|
#7 | 2822099-7.patch | 2.43 KB | benjy |
#2 | 2822099-2.patch | 1.5 KB | benjy |
Comments
Comment #2
benjy CreditAttribution: benjy commentedAhh, I broke that recently, it doesn't work for content entities without a bundle. Try the attached patch, just needs a test.
Comment #5
benjy CreditAttribution: benjy commentedPatch passes against 8.2 but fails against 8.3, interesting.
Comment #6
benjy CreditAttribution: benjy at PreviousNext commentedOK, fails are fixed in HEAD, this is green against both branches now. We just need a new test and I can commit this.
Comment #7
benjy CreditAttribution: benjy at PreviousNext commentedWith a test.
Comment #8
benjy CreditAttribution: benjy at PreviousNext commentedCommitted and pushed.
Comment #10
Sutharsan CreditAttribution: Sutharsan as a volunteer commentedThanks for the fast response. Code makes sense, patch fixes the problem.
Comment #12
ExTexan CreditAttribution: ExTexan commentedThis 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?
Comment #13
benjy CreditAttribution: benjy at PreviousNext commentedNo 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.