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
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) {
Comment | File | Size | Author |
---|---|---|---|
#10 | warnings_with_reset-2647622-10.patch | 433 bytes | dxx |
#7 | ds-fix-layout-settings-warnings-2647622-7-8.x.patch | 1.99 KB | aspilicious |
#4 | ds-fix-layout-settings-warnings-2647622-4-8.x.patch | 1.85 KB | wtrv |
Comments
Comment #2
dxx CreditAttribution: dxx commentedComment #3
dxx CreditAttribution: dxx commentedComment #4
wtrv CreditAttribution: wtrv at Wunder commentedIncluded a patch that fixes the warning
Comment #5
wtrv CreditAttribution: wtrv commentedComment #6
aspilicious CreditAttribution: aspilicious commentedCan someone write a test for this?
It shouldn't be harder than adding a test somewhere in the suite that enabled the reset layout.
Comment #7
aspilicious CreditAttribution: aspilicious commentedA 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!
Comment #8
aspilicious CreditAttribution: aspilicious commentedComment #10
dxx CreditAttribution: dxx commentedHi,
I have tested the current --dev version but bug is back:
Comment #11
aspilicious CreditAttribution: aspilicious commentedComment #15
aspilicious CreditAttribution: aspilicious commentedTested 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?
Comment #16
aspilicious CreditAttribution: aspilicious commented