Details
-
Type:
Improvement
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: 1.1.4
-
Fix Version/s: 1.2.0-BETA1
-
Component/s: Behaviors
-
Labels:None
Description
I've modified SoftDelete so that the preDqlSelect part is only applied when a specific param in the Manager is set. Currently this works like expected, but I've discovered a small problem, when I've enabled the QueryCache:
Since SoftDelete adds the "where is_deleted=0" as a pendingJoinCondition it isn't taken into account by the calculateXXXCacheHash function ![]()
I've made a small patch to Query/Abstract.php that takes the pendingCondition into account
Activity
Florian Pfeiffer
made changes -
| Field | Original Value | New Value |
|---|---|---|
| Attachment | abstract.diff [ 10076 ] |
Florian Pfeiffer
made changes -
| Description |
I've modified SoftDelete so that the preDqlSelect part is only applied when a specific param in the Manager is set. Currently this works like expected, but I've discovered a small problem, when I've enabled the QueryCache: Since SoftDelete adds the "where is_deleted=0" as a pendingJoinCondition it isn't taken into account by the calculateXXXCacheHash function :( I've made a small patch to Query/Abstract.php that takes the pendingCondition into account: Index: Abstract.php =================================================================== --- Abstract.php (revision 6260) +++ Abstract.php (revision 6261) @@ -1001,7 +1001,9 @@ public function calculateQueryCacheHash() { $dql = $this->getDql(); - $hash = md5($dql . 'DOCTRINE_QUERY_CACHE_SALT'); + $pending = serialize($this->_pendingJoinConditions); + + $hash = md5($dql . $pending . 'DOCTRINE_QUERY_CACHE_SALT'); return $hash; } @@ -1015,9 +1017,10 @@ public function calculateResultCacheHash($params = array()) { $dql = $this->getDql(); + $pending = serialize($this->_pendingJoinConditions); $conn = $this->getConnection(); $params = $this->getFlattenedParams($params); - $hash = md5($this->_hydrator->getHydrationMode() . $conn->getName() . $conn->getOption('dsn') . $dql . var_export($params, true)); + $hash = md5($this->_hydrator->getHydrationMode() . $conn->getName() . $conn->getOption('dsn') . $dql . $pending . var_export($params, true)); return $hash; } |
I've modified SoftDelete so that the preDqlSelect part is only applied when a specific param in the Manager is set. Currently this works like expected, but I've discovered a small problem, when I've enabled the QueryCache: Since SoftDelete adds the "where is_deleted=0" as a pendingJoinCondition it isn't taken into account by the calculateXXXCacheHash function :( I've made a small patch to Query/Abstract.php that takes the pendingCondition into account |
Jonathan H. Wage
made changes -
| Status | Open [ 1 ] | Closed [ 6 ] |
| Fix Version/s | 1.2.0-BETA1 [ 10035 ] | |
| Resolution | Fixed [ 1 ] |