When adding a where_group as the very first where group the code fails. its says max() requires at least one element. this fixed it

Index: /home/scott/core/comm/comm/html/sites/all/modules/contrib/views/plugins/views_plugin_query_default.inc
index 11fb79a..fcce054 100644
--- a/html/sites/all/modules/contrib/views/plugins/views_plugin_query_default.inc
+++ b/html/sites/all/modules/contrib/views/plugins/views_plugin_query_default.inc
@@ -655,6 +655,10 @@ class views_plugin_query_default extends views_plugin_query{
   function set_where_group($type = 'AND', $group = NULL, $where = 'where') {
     // Set an alias.
     $groups = &$this->$where;
+    
+    if (empty($groups)) {
+      $group = 0;
+    }
 
     if (!isset($group)) {
       $group = max(array_keys($groups)) + 1;

Comments

Scott Reynolds’s picture

For the contrib module I work on I got around this way: http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/activity/vi...

But this is still an issue.

merlinofchaos’s picture

Status: Needs review » Closed (duplicate)