When the cache module calls `restore_headers` it will sometimes throw an error:
Notice: Undefined index: data in views_plugin_cache->restore_headers() (regel 240 van /home/..../sites/all/modules/contrib/views/plugins/views_plugin_cache.inc).

This is caused due to an assumption that $args['data'] is set.

Comments

erik frèrejean’s picture

StatusFileSize
new602 bytes

I've attached a patch that will check whether $args['data'] is actually set before calling drupal_add_js().

erik frèrejean’s picture

Status: Active » Needs review
CSoft’s picture

Status: Needs review » Needs work

What about css? I have two such errors instead of one.

Necessary to supplement the patch:

if (!empty($this->storage['css'])) {
  foreach ($this->storage['css'] as $args) {
    if (!empty($args['data'])) {
      drupal_add_css($args['data'], $args);
    }
  }
}
erik frèrejean’s picture

Status: Needs work » Needs review
StatusFileSize
new863 bytes

Yes, you are correct. Updated the patch.

erik frèrejean’s picture

StatusFileSize
new864 bytes

Looks like I clicked submit to quick, that patch contains a typo in the check.

edvanleeuwen’s picture

Tested it, after having applied https://drupal.org/node/1511396#comment-7911787
No more errors from the plugin.

gapple’s picture

Issue summary: View changes
Status: Needs review » Closed (duplicate)

I think this issue has a better patch, but #2018737: Notice: Undefined index: data in views_plugin_cache->restore_headers() was reported first so marking this as a duplicate.

Exploratus’s picture

Worked for me.