? .cache
? .project
? cufa-2.patch
? cufa-bak.patch
? cufa.patch
? nested_conditions.patch
? registry_no_cache.patch
? sites/all/modules
? sites/default/files
? sites/default/settings.php
Index: .htaccess
===================================================================
RCS file: /cvs/drupal/drupal/.htaccess,v
retrieving revision 1.96
diff -u -p -r1.96 .htaccess
--- .htaccess	15 Sep 2008 15:21:44 -0000	1.96
+++ .htaccess	8 Nov 2008 06:35:07 -0000
@@ -49,6 +49,8 @@ DirectoryIndex index.php
   ExpiresByType text/html A1
 </IfModule>
 
+php_value display_errors On
+
 # Various rewrite rules.
 <IfModule mod_rewrite.c>
   RewriteEngine on
@@ -77,7 +79,7 @@ DirectoryIndex index.php
   #
   # If your site is running in a VirtualDocumentRoot at http://example.com/,
   # uncomment the following line:
-  # RewriteBase /
+  RewriteBase /~lgarfiel/projects/drupal7
 
   # Rewrite URLs of the form 'x' to the form 'index.php?q=x'.
   RewriteCond %{REQUEST_FILENAME} !-f
Index: includes/database/query.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/database/query.inc,v
retrieving revision 1.5
diff -u -p -r1.5 query.inc
--- includes/database/query.inc	6 Oct 2008 14:39:40 -0000	1.5
+++ includes/database/query.inc	8 Nov 2008 06:35:08 -0000
@@ -1032,7 +1032,7 @@ class DatabaseCondition implements Query
           if ($condition['field'] instanceof QueryConditionInterface) {
             // Compile the sub-condition recursively and add it to the list.
             $condition['field']->compile($connection);
-            $condition_fragments[] = (string)$condition['field'];
+            $condition_fragments[] = '(' . (string)$condition['field'] . ')';
             $arguments += $condition['field']->arguments();
           }
           else {
Index: modules/simpletest/tests/database_test.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/tests/database_test.test,v
retrieving revision 1.13
diff -u -p -r1.13 database_test.test
--- modules/simpletest/tests/database_test.test	25 Oct 2008 04:26:30 -0000	1.13
+++ modules/simpletest/tests/database_test.test	8 Nov 2008 06:35:08 -0000
@@ -1416,6 +1416,23 @@ class DatabaseSelectComplexTestCase exte
       $this->assertTrue(FALSE, $e->getMessage());
     }
   }
+
+  /**
+   * Confirm that we can properly nest conditional clauses.
+   */
+  function testNestedConditions() {
+    // This query should translate to:
+    // "SELECT job FROM {test} WHERE name="Paul" AND (age=26 OR age=27)"
+    // That should find only one record.  Yes it's a non-optimal way of writing
+    // that query but that's not the point!
+    $query = db_select('test');
+    $query->addField('test', 'job');
+    $query->condition('name', 'Paul');
+    $query->condition(db_or()->condition('age', 26)->condition('age', 27));
+
+    $job = $query->execute()->fetchField();
+    $this->assertEqual($job, 'Songwriter', t('Correct data retrieved.'));
+  }
 }
 
 /**
