Problem/Motivation

Warning : Invalid argument supplied for foreach() dans ds_preprocess_ds_layout() (ligne 330 de /var/www/docroot/modules/contrib/ds/ds.module).

Steps to reproduce the problem

  • Go to any entity display mode and choose the RESET layout
  • Check the display view on the front

Code:

  // Create region variables based on the layout settings.
  foreach ($layout_settings['wrappers'] as $region_name => $wrapper) {
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dxx created an issue. See original summary.

dxx’s picture

Issue summary: View changes
dxx’s picture

Issue summary: View changes
wtrv’s picture

Included a patch that fixes the warning

wtrv’s picture

Status: Active » Needs review
aspilicious’s picture

Status: Needs review » Needs work
Issue tags: -Layout, -viewMode +Needs tests

Can someone write a test for this?
It shouldn't be harder than adding a test somewhere in the suite that enabled the reset layout.

aspilicious’s picture

Status: Needs work » Needs review
FileSize
1.99 KB

A test revealed that the proposed fix was incorrect.
The config schema of a layout requires all the layout stuff including the wrappers.
So I took a different approach and just removed the options from the display but they actually get saved now.

No more config errors!

aspilicious’s picture

Status: Needs review » Fixed

  • aspilicious committed e887644 on 8.x-2.x
    Issue #2647622 by wtrv, aspilicious: Warnings with reset layout
    
dxx’s picture

Status: Fixed » Needs work
FileSize
433 bytes

Hi,

I have tested the current --dev version but bug is back:

Warning: Invalid argument supplied for foreach() in ds_preprocess_ds_layout() (line 331 of modules/contrib/ds/ds.module).

aspilicious’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 10: warnings_with_reset-2647622-10.patch, failed testing.

The last submitted patch, 10: warnings_with_reset-2647622-10.patch, failed testing.

The last submitted patch, 10: warnings_with_reset-2647622-10.patch, failed testing.

aspilicious’s picture

Tested it manually again.
And reviewed the test once more, this is actually fixed.
Are you sure you're on the latest dev version?
Did you resave your layout?

aspilicious’s picture

Status: Needs work » Closed (fixed)