Closed (duplicate)
Project:
Views (for Drupal 7)
Version:
6.x-2.5
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
16 Apr 2009 at 23:47 UTC
Updated:
2 Jun 2009 at 18:47 UTC
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
Comment #1
Scott Reynolds commentedFor 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.
Comment #2
merlinofchaos commented#419270: set_where_group fails when no where arguments added