Warning: Invalid argument supplied for foreach() in field_view_mode_settings() (line 637 web/modules/field/field.module).

This is caused by entity_get_info() being handed 'ds_views' as its entity_type.

It is function field_view_mode_settings() called in ds.module that is providing this value, which in turn got it from ds_get_layout() called in ds_extras.module, via a theme function originating in contrib/views/plugins/views_plugin_display.inc with our views_view__projects__page being called.

CommentFileSizeAuthor
#9 1262706.patch2.02 KBswentel
#3 1262706.patch888 bytesswentel

Comments

mlncn’s picture

mlncn’s picture

Possible that saving some Views settings related to Display Suite made it the notice go away: http://pad.agariclabs.org:9001/p/8x7XeVMiQU

swentel’s picture

StatusFileSize
new888 bytes

Hmm I don't think #1 is related with this. I've got a patch which more or less checks for the same thing as in ds.module itself (the $variables['elements') - although I don't think this would remove the notices) Will do some more tests this weekend.

swentel’s picture

Status: Active » Needs work
mlncn’s picture

Disabling the Views Display option (ds_extras_vd) in Display Suite Extras gets rid of the notice.

Note: We did not have any Views Displays defined, perhaps defining one also gets rid of the notice!

mlncn’s picture

Also swentel++ for being the most responsive module maintainer pretty much ever.

swentel’s picture

Damn, I was able to get the notice once and then started coding. Reverted than all my changes and couldn't reproduce it anymore. When I step through the code of Drupal core, it seems like there is some sort of racing condition going on re: caching of bundle settings and entity info. More tests later this week. Note, path in #3 doens't fix anything here, it's really something else.

swentel’s picture

Ok, I can reproduce it. It's a fun racing condition somewhere in core, so it's most likely a bug in core, however, I'll try to fix this in DS as well. To reproduce do this:

- disable views displays
- clear cache via the performance settings page
- enable views displays
- go to say the frontpage view that comes with views -> you'll see the notice
- save the settings screen again of ds extras just once (without any changes) - or clear cache view performance settings page, doesn't matter
- go again to frontpage view -> notice is gone

Let's see if can fix this now :)

swentel’s picture

Status: Needs work » Fixed
StatusFileSize
new2.02 KB

Aaaaand fixed :) patch attached as well, which cleans up something more as well when managing the layouts. The variable_set('menu_rebuild_needed') is the trick to get rid of the notices though.

Status: Fixed » Closed (fixed)

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