Every time I run /update.php (for any module needing an update), I get this set of 4 rows of the same error:

Notice: Undefined index: style_options in views_handler_argument->init() (line 86 of /path-to-drupal-folder/sites/all/modules/views/handlers/views_handler_argument.inc).
Notice: Undefined index: style_options in views_handler_argument->init() (line 86 of /path-to-drupal-folder/sites/all/modules/views/handlers/views_handler_argument.inc).
Notice: Undefined index: style_options in views_handler_argument->init() (line 86 of /path-to-drupal-folder/sites/all/modules/views/handlers/views_handler_argument.inc).
Notice: Undefined index: style_options in views_handler_argument->init() (line 86 of /path-to-drupal-folder/sites/all/modules/views/handlers/views_handler_argument.inc).

Whatever this error is, it's significant enough that it seems to be causing timeouts and other issues. It seems like I need to not ignore it. However, I haven't been able to find a style_options error anywhere. Anyone know what this is?

CommentFileSizeAuthor
#1 1467204.patch736 bytesdawehner

Comments

dawehner’s picture

Status: Active » Needs review
StatusFileSize
new736 bytes

Here is a small fix for that, though it would be better to actually understand how this can happen.

tim.plunkett’s picture

Status: Needs review » Reviewed & tested by the community

So these sections of code that look for something in $options['style_options'] is only for backwards compatibility. So there is a chance that it won't be passed anymore, so this is the correct fix.

dawehner’s picture

Status: Reviewed & tested by the community » Fixed

Thanks as always for the review! Committed to 7.x-3.x

somatics’s picture

Wow, thanks for the rapid response and solution! I'm excited to install this -- it was amazing how much this messed up the update process.

Not to look a gift horse in the mouth, but would someone mind explaining this to me? I don't quite understand what @tim.plunkett says in #2. Does this fix actually disable a needed function in Views? Is it it now allowing old code in Views that shouldn't be there because it's no longer checking for it, or is it now making an updated site not work with older style options? Or something like that? As you can tell, I'm pretty unclear on what you guys are talking about, and it seems like with Views, the more I know, the less I screw up my sites! :)

tim.plunkett’s picture

+++ b/handlers/views_handler_argument.incundefined
@@ -79,6 +79,9 @@ class views_handler_argument extends views_handler {
     if (!isset($options['summary']['sort_order']) && !empty($options['default_action']) && $options['default_action'] == 'summary asc') {
       $this->options['default_action'] = 'summary';
       $this->options['summary']['sort_order'] = 'asc';

The value of summary asc was a valid value for default_action in an older version of Views.

As it shows here, it switches it to just summary and sets the newer sort_order key to ascending.

This is a common use for init(), translating old values into new ones. $options['style_options'] is only used in these conversions, and would only be present in an older View, and isn't needed in Views currently.

Hope that explains it! If not, come find me on IRC as timplunkett and I'll try to explain better.

somatics’s picture

Follow up: I installed the latest dev version later that day, and pushed it to my live site and ran updates. The site no longer throws these errors when I update, and update time has improved dramatically, with less situations of weird output and page loads on update completion. It appears to have cleaned out a big underlying mess during the updates.

Thanks again for such a swift and effective response to this! My database thanks you too!

Status: Fixed » Closed (fixed)

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