summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEarl Miles2008-04-13 21:34:06 (GMT)
committer Earl Miles2008-04-13 21:34:06 (GMT)
commitae66c35f0c49dc09169a5c5b5df60fef88532465 (patch)
tree9da2e89f2f75a4930ede08d7552de28d697bf325
parentb3386ea51a80bc557f47b4e4a86d64d98beba34a (diff)
#239115: On PHP4, all views appeared as the frontpage view due to PHP reference weirdness.
-rw-r--r--views.module6
1 files changed, 6 insertions, 0 deletions
diff --git a/views.module b/views.module
index 23d0a7f..88f7c0a 100644
--- a/views.module
+++ b/views.module
@@ -832,6 +832,8 @@ function views_get_block_views() {
* @endcode
*/
function views_get_applicable_views($type) {
+ // @todo: Use a smarter flagging system so that we don't have to
+ // load every view for this.
$result = array();
$views = views_get_all_views();
@@ -856,6 +858,10 @@ function views_get_applicable_views($type) {
if ($v->set_display($display->id)) {
$result[] = array($v, $display->id);
}
+ // In PHP 4.4.7 and presumably earlier, if we do not unset $v
+ // here, we will find that it actually overwrites references
+ // possibly due to shallow copying issues.
+ unset($v);
}
}
}