Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

select() + withColumn() query error after upgrading to version 1.6.8 #608

Closed
nibsirahsieu opened this issue Feb 16, 2013 · 3 comments
Closed
Labels

Comments

@nibsirahsieu
Copy link
Contributor

before upgrading to version 1.6.8, the following query runs fine:

   $c = new ModelCriteria('bookstore', 'Author');
   $c->join('Book');
   $c->withColumn('COUNT(Book.Id)', 'nbBooks');
   $c->select(array('FirstName', 'LastName'));
   $rows = $c->find();

but, after upgrading to version 1.6.8, i have to include the nbBooks column into the array select(), for example:

   $c = new ModelCriteria('bookstore', 'Author');
   $c->join('Book');
   $c->withColumn('COUNT(Book.Id)', 'nbBooks');
   $c->select(array('FirstName', 'LastName', 'nbBooks'));
   $rows = $c->find();

after tracking down the source code, the error occurs because variable $this->asColumns is resetted by this code.
If i comment out that code, my code work fine, but this test will fail.

@staabm
Copy link
Member

staabm commented Feb 16, 2013

The corresponding line was changed in 130f941

@staabm
Copy link
Member

staabm commented Feb 16, 2013

I will investigate further

@nibsirahsieu
Copy link
Contributor Author

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants