Browse files


In beforeFind it has to be getTableAlias() not getTableAlias(false, false) as there might be an alias set by query criteria
  • Loading branch information...
1 parent c658823 commit f63cb41215daea3a9680cb15c6be53707851870e @cebe cebe committed Sep 7, 2012
Showing with 3 additions and 4 deletions.
  1. +3 −4 UPGRADE
@@ -1,4 +1,3 @@
Upgrading Instructions for Yii Framework v1.1.13
@@ -28,13 +27,13 @@ Upgrading from v1.1.12
Since version 1.1.13 changes to query criteria made in beforeFind() now also apply to the query when model is loaded in a relational context.
The main problem here is that you can not use the `t`-alias for your table anymore, you have to change your code to
use the table alias currently in use as this it different in relational context.
- You can get that alias by calling `$this->getTableAlias(false, false);` in your active record class
- or `$this->owner->getTableAlias(false, false)` in behavior context.
+ You can get that alias by calling `$this->getTableAlias();` in your active record class
+ or `$this->owner->getTableAlias()` in behavior context.
$criteria->condition = 't.myfield = 1';
You need to change that to:
- $alias = $this->owner->getTableAlias(false, false);
+ $alias = $this->owner->getTableAlias();
$criteria->condition = $alias.'.myfield = 1';
Upgrading from v1.1.11

0 comments on commit f63cb41

Please sign in to comment.