I have visited display suite manage display page & I got some notice errors so I have report this issue. The current ds version which I am using is 8.x-3.4 and drupal core version is 8.7.8.

Issue fork ds-3091319

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Devendra Mishra created an issue. See original summary.

Devendra Mishra’s picture

Here is the patch

Devendra Mishra’s picture

Status: Active » Needs review
Devendra Mishra’s picture

FileSize
1.25 KB
Devendra Mishra’s picture

Assigned: Unassigned » Devendra Mishra

Please review attached patch & let me know if it help to fix these notices.

swentel’s picture

Status: Needs review » Postponed (maintainer needs more info)

Hmm how can I reproduce the notices ?

Also, I think we can simplify the code by just doing something like this:

      if (empty($row) || $row['mode'] == $view_mode) {
        continue;
      }
mediameriquat’s picture

Anybody got such a problem with DS 8.x-3.12, with Drupal 9.2.0, using a Bootstrap Theme?

Here is the full error message :

Notice: Undefined index: #type in _ds_field_ui_table_layouts() (line 826 of modules/ds/includes/field_ui.inc).

_ds_field_ui_table_layouts('node', 'speaker', 'full', Array, Object) (Line: 51)
ds_field_ui_fields_layouts(Array, Object) (Line: 241)
ds_form_entity_view_display_edit_form_alter(Array, Object, 'entity_view_display_edit_form') (Line: 539)
Drupal\Core\Extension\ModuleHandler->alter('form', Array, Object, 'entity_view_display_edit_form') (Line: 836)
Drupal\Core\Form\FormBuilder->prepareForm('entity_view_display_edit_form', Array, Object) (Line: 279)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 73)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 578)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 158)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 80)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 50)
Drupal\ban\BanMiddleware->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 52)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 716)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

Rar9’s picture

yes on D9.2.0 with 3.12.0 I´m getting with Radix a BS4 theme

Error message
Notice: Undefined index: #type in _ds_field_ui_table_layouts() (line 826 of modules/contrib/ds/includes/field_ui.inc).

The above patch will not apply

FMB made their first commit to this issue’s fork.

FMB’s picture

Status: Postponed (maintainer needs more info) » Needs review

Getting same errors as mediameriqua, see merge request.

(Click plain diff link to get a patch.)

sbrenner02’s picture

Jut updated and getting this now on D9 with DS 3.11

hamadknows’s picture

Getting same warning on D9

Notice: Undefined index: #type in _ds_field_ui_table_layouts() (line 826 of modules/contrib/ds/includes/field_ui.inc).
merlin06’s picture

Version: 8.x-3.4 » 8.x-3.13
Assigned: Devendra Mishra » merlin06
FileSize
758 bytes

Error appears on /admin/structure/types/manage/%/display/teaser and other display forms.
Notice: Undefined index: #type in _ds_field_ui_table_layouts() (line 826 of /srv/www/sites/brad82.dev.drupal.local/web/modules/contrib/ds/includes/field_ui.inc)

This patch applies to 8.x-3.13.
The offending section of code is commented out in 8.x-4.x-dev so the maintainer is already aware of this issue.

Any module that overrides LayoutDefault::buildConfigurationForm() and then calls parent::buildConfigurationForm() receives a value of $form['context_mapping']. Display Suite isn't handling this correctly.

jannakha’s picture

Status: Needs review » Reviewed & tested by the community
bart lambert’s picture

Here the same error on D9.2.4 and DS-module 8.3.13. using AT-theme 2.0

Notice: Undefined index: #type in _ds_field_ui_table_layouts() (regel 826 van /data/sites/web/modelspoorhobbybe/www/modules/contrib/ds/includes/field_ui.inc)

#0 /data/sites/web/modelspoorhobbybe/www/core/includes/bootstrap.inc(312): _drupal_error_handler_real()
#1 /data/sites/web/modelspoorhobbybe/www/modules/contrib/ds/includes/field_ui.inc(826): _drupal_error_handler()
#2 /data/sites/web/modelspoorhobbybe/www/modules/contrib/ds/includes/field_ui.inc(51): _ds_field_ui_table_layouts()
#3 /data/sites/web/modelspoorhobbybe/www/modules/contrib/ds/ds.module(241): ds_field_ui_fields_layouts()
#4 /data/sites/web/modelspoorhobbybe/www/core/lib/Drupal/Core/Extension/ModuleHandler.php(539): ds_form_entity_view_display_edit_form_alter()
#5 /data/sites/web/modelspoorhobbybe/www/core/lib/Drupal/Core/Form/FormBuilder.php(836): Drupal\Core\Extension\ModuleHandler->alter()
#6 /data/sites/web/modelspoorhobbybe/www/core/lib/Drupal/Core/Form/FormBuilder.php(279): Drupal\Core\Form\FormBuilder->prepareForm()
#7 /data/sites/web/modelspoorhobbybe/www/core/lib/Drupal/Core/Controller/FormController.php(73): Drupal\Core\Form\FormBuilder->buildForm()
#8 [internal function]: Drupal\Core\Controller\FormController->getContentResult()
#9 /data/sites/web/modelspoorhobbybe/www/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array()
#10 /data/sites/web/modelspoorhobbybe/www/core/lib/Drupal/Core/Render/Renderer.php(578): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#11 /data/sites/web/modelspoorhobbybe/www/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext()
#12 /data/sites/web/modelspoorhobbybe/www/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext()
#13 /data/sites/web/modelspoorhobbybe/www/vendor/symfony/http-kernel/HttpKernel.php(158): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#14 /data/sites/web/modelspoorhobbybe/www/vendor/symfony/http-kernel/HttpKernel.php(80): Symfony\Component\HttpKernel\HttpKernel->handleRaw()
#15 /data/sites/web/modelspoorhobbybe/www/core/lib/Drupal/Core/StackMiddleware/Session.php(57): Symfony\Component\HttpKernel\HttpKernel->handle()
#16 /data/sites/web/modelspoorhobbybe/www/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(47): Drupal\Core\StackMiddleware\Session->handle()
#17 /data/sites/web/modelspoorhobbybe/www/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle()
#18 /data/sites/web/modelspoorhobbybe/www/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass()
#19 /data/sites/web/modelspoorhobbybe/www/modules/contrib/advban/src/AdvbanMiddleware.php(57): Drupal\page_cache\StackMiddleware\PageCache->handle()
#20 /data/sites/web/modelspoorhobbybe/www/core/modules/ban/src/BanMiddleware.php(50): Drupal\advban\AdvbanMiddleware->handle()
#21 /data/sites/web/modelspoorhobbybe/www/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(47): Drupal\ban\BanMiddleware->handle()
#22 /data/sites/web/modelspoorhobbybe/www/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(52): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle()
#23 /data/sites/web/modelspoorhobbybe/www/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle()
#24 /data/sites/web/modelspoorhobbybe/www/core/lib/Drupal/Core/DrupalKernel.php(717): Stack\StackedHttpKernel->handle()
#25 /data/sites/web/modelspoorhobbybe/www/index.php(19): Drupal\Core\DrupalKernel->handle()
#26 {main}
.

MLZR’s picture

I apply #14 and this works.
(Apply the patch by hand, so I don't know what happens with 'patch' command, -> in reaction of 'patch failed to apply')

2pha’s picture

Title: Notice: Undefined index: mode in _ds_field_ui_table_layouts() » Notice: Undefined index: #type in _ds_field_ui_table_layouts()

I got this too when using the bootstrap barrio theme.
Updating issue title to reflect current notice people are experiencing.

gerzenstl’s picture

I can also confirm #14 works.

On my case I have installed bootstrap barrio theme. This error happens when you select one of the layouts provided by this theme.

ainsofs’s picture

#14 worked for me too on ds 3.13.0 and d 9.2.6 using bootstrap theme 8.x-3.23

bart lambert’s picture

#14 works for me as wel on 8.x-3.13/ D9.2.7/PHP8.0.12
error was located on line 826 of field_ui.inc

ABaier’s picture

Thanks, #14 works also for me.

DS 8.x-3.13 / Core 9.2.10 / PHP 7.4.26 / adaptivetheme

prabha1997’s picture

#14 Worked for me.

Core 9.3.0 / PHP 7.4.0 / DS 8.x-3.13 / Gin

Alex Malkov’s picture

Thanks, #14 works for me.

DS 8.x-3.13 / Core 9.3.3 / PHP 8.0.15 / Adaptivetheme

MLZR’s picture

#14 works for me.
DS 8.x-3.13 / Core 9.3.5 / PHP 7.4 / Bootstrap 8.x-3.23 (in subtheme)

Thanks!

newswatch’s picture

Confirmed: Patch #14 works for me. Thank you.

acbramley made their first commit to this issue’s fork.

swentel’s picture

Version: 8.x-3.13 » 5.0.x-dev

  • swentel committed 7eb41a1 on 5.0.x
    Issue #3091319 by Devendra Mishra, FMB, merlin06, acbramley: Notice:...
swentel’s picture

Status: Reviewed & tested by the community » Fixed

committed and pushed

swentel’s picture

Status: Fixed » Closed (fixed)
newswatch’s picture

UPDATE from my own #26 comment:

After upgrade doesn't work on Drupal 9.5.0 and PHP 8.1.13.

UPDATE (15 Jan 2023): Doesn't work on D 9.5.1, PHP 8.1.14, DS 8.3.15

janvier005’s picture

Version: 5.0.x-dev » 8.x-3.15
Component: Field UI » Code

I can confirm that the problem remains visible in Drupal 9.5.1 and that the patch #14 worked for me.

acbramley’s picture

Version: 8.x-3.15 » 8.x-3.x-dev
FileSize
738 bytes

This still needs a backport to 8.x-3.x, here's a reroll.

EDIT: Hmm seems vim messed up the indentation, can just be fixed on commit :)

MLZR’s picture

Hello, I have the site + environment updated and all modules new installed. This problem occurred again (see #25) and again I applied the patch #14. This works (again).. top.

the environment now is PHP 8.1, Drupal 9.5.2, and Bootstrap 8.x-3.25 - DS 8.x-3.15 new installed (so I had to patch again)

tvb’s picture

Patch #34 fixes the issue.

Drupal 9.5.2 | PHP 8.1.13 | DS 8.x-3.15 | bootstrap5 3.0.3

khanz’s picture

Warning: Undefined array key "#type" in _ds_field_ui_table_layouts()

Was getting a similar error with Drupal - 9.5.10 and PHP - 8.1.21, which goes away after applying patch #34. Can a new version be released with the above patch?

jannakha’s picture

it looks like it was merged into v5, but not released for v3
if you're on v3 - use a patch #14 (which is the same as patch #34)

Mupsi’s picture

Can confirm I had the notice on a Drupal 10.1.7 instance with DS 3.15, after a migration from 9.5.11. Patch in #14 fixed it for me :)

LeDucDuBleuet’s picture

This issue is marked as fixed but the patch is still not included in the new release 8.x-3.16.

The status should be RTBC and this needs to be included in a new release please.

Thank you!

swentel’s picture

Just committed that to 8.x-3.x as well - will come up in a new release with more fixes for D10.1 and higher (plus hopefully some stuff I've done in 5.0.x which are easy to backport)

entropea’s picture

Just a heads up... If I select "No display" to avoid this error, the "Expert" field formatter settings are not saved and there is no error message. Just in case anyone comes across this. Patch #14 worked on 10.1 for me.