? -
? .git
? .kdev4
? 0,
? 0001-convert-user-argument-validation-to-dbng.patch
? 788950-override.patch
? 856186-remove-views_handlers_1.patch
? NULL,
? TRUE,
? b
? complex-views-799604.patch
? display-removed-
? field-sortable.patch
? foo.patch
? id,
? order,
? position
? position,
? reorder-displays_5_0.patch
? sibling,
? views-722454-8-fix-taxonomy-integration.patch
? views-873238-css.patch
? views-DRUPAL-7--3.kdev4
? views-drupal_clean_css_identifier_0.patch
? views-new-paths.patch
Index: handlers/views_handler_argument_formula.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/views/handlers/views_handler_argument_formula.inc,v
retrieving revision 1.1.6.1
diff -u -p -r1.1.6.1 views_handler_argument_formula.inc
--- handlers/views_handler_argument_formula.inc	2 Nov 2009 22:01:25 -0000	1.1.6.1
+++ handlers/views_handler_argument_formula.inc	9 Aug 2010 09:01:54 -0000
@@ -50,6 +50,6 @@ class views_handler_argument_formula ext
     // Now that our table is secure, get our formula.
     $formula = $this->get_formula();
 
-    $this->query->add_where(0, $formula, $this->argument);
+    $this->query->add_where(0, $formula, $this->argument, 'formula');
   }
 }
Index: handlers/views_handler_argument_string.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/views/handlers/views_handler_argument_string.inc,v
retrieving revision 1.5.4.1
diff -u -p -r1.5.4.1 views_handler_argument_string.inc
--- handlers/views_handler_argument_string.inc	2 Nov 2009 22:01:25 -0000	1.5.4.1
+++ handlers/views_handler_argument_string.inc	9 Aug 2010 09:01:54 -0000
@@ -124,7 +124,13 @@ class views_handler_argument_string exte
     else {
       // Add the field.
       $formula = $this->get_formula();
-      $this->base_alias = $this->name_alias = $this->query->add_field(NULL, $formula, $this->field . '_truncated');
+      $params = array(
+        'placeholders' => array(
+          ':length' => intval($this->options['limit']),
+        ),
+      );
+
+      $this->base_alias = $this->name_alias = $this->query->add_field(NULL, $formula, $this->field . '_truncated', $params);
       $this->query->set_count_field(NULL, $formula, $this->field, $this->field . '_truncated');
     }
 
@@ -137,7 +143,7 @@ class views_handler_argument_string exte
    * $this->ensure_my_table() MUST have been called prior to this.
    */
   function get_formula() {
-    return "SUBSTR($this->table_alias.$this->real_field, 1, " . intval($this->options['limit']) . ")";
+    return "SUBSTRING($this->table_alias.$this->real_field, 1, :length)";
   }
 
   /**
@@ -164,10 +170,21 @@ class views_handler_argument_string exte
       $field = "$this->table_alias.$this->real_field";
     }
     else {
+      $formula = TRUE;
       $field = $this->get_formula();
     }
 
-    $this->query->add_where(0, $field, $argument);
+    if ($formula) {
+      $field .= ' = :views_handler_argument_string';
+      $argument = array(
+        ':length' => intval($this->options['limit']),
+        ':views_handler_argument_string' => $argument,
+      );
+      $this->query->add_where(0, $field, $argument, 'formula');
+    }
+    else {
+      $this->query->add_where(0, $field, $argument);
+    }
   }
 
   function summary_argument($data) {
Index: plugins/views_plugin_query_default.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/views/plugins/Attic/views_plugin_query_default.inc,v
retrieving revision 1.1.4.20
diff -u -p -r1.1.4.20 views_plugin_query_default.inc
--- plugins/views_plugin_query_default.inc	27 Jul 2010 21:41:07 -0000	1.1.4.20
+++ plugins/views_plugin_query_default.inc	9 Aug 2010 09:01:57 -0000
@@ -658,7 +658,7 @@ class views_plugin_query_default extends
     // We limit the length of the original alias up to 60 characters
     // to get a unique alias later if its have duplicates
     $alias = substr($alias, 0, 60);
-
+       
     // Create a field info array.
     $field_info = array(
       'field' => $field,
@@ -678,7 +678,7 @@ class views_plugin_query_default extends
     if (empty($this->fields[$alias])) {
       $this->fields[$alias] = $field_info;
     }
-
+    
     return $alias;
   }
 
@@ -876,7 +876,12 @@ class views_plugin_query_default extends
     foreach ($this->$where as $group => $info) {
       $sub_group = $info['type'] == 'OR' ? db_or() : db_and();
       foreach ($info['conditions'] as $key => $clause) {
-        $sub_group->condition($clause['field'], $clause['value'], $clause['operator']);
+        if ($clause['operator'] == 'formula') {
+          $sub_group->where($clause['field'], $clause['value']);
+        }
+        else {
+          $sub_group->condition($clause['field'], $clause['value'], $clause['operator']);
+        }
       }
       $main_group->condition($sub_group);
     }
@@ -911,14 +916,16 @@ class views_plugin_query_default extends
         $info = $this->get_aggregation_info();
         if (!empty($info[$field['function']]['method']) && function_exists($info[$field['function']]['method'])) {
           $string = $info[$field['function']]['method']($field['function'], $string);
-          $query->addExpression($string, $fieldname);
+          $placeholders = !empty($field['placeholders']) ? $field['placeholders'] : array();
+          $query->addExpression($string, $fieldname, $placeholders);
         }
 
         $this->has_aggregate = TRUE;
       }
       // This is a formula, using no tables.
       elseif (empty($field['table'])) {
-        $query->addExpression($string, $fieldname);
+        $placeholders = !empty($field['placeholders']) ? $field['placeholders'] : array();
+        $query->addExpression($string, $fieldname, $placeholders);
       }
 
       elseif ($this->distinct && !in_array($fieldname, $this->groupby)) {
