aboutsummaryrefslogtreecommitdiff
path: root/engine/lib
diff options
context:
space:
mode:
authorPaweł Sroka <srokap@gmail.com>2013-10-27 05:17:55 -0700
committerPaweł Sroka <srokap@gmail.com>2013-10-27 05:17:55 -0700
commite0b7270c6e770338259b1aa4bb919c81bb71eb13 (patch)
tree6d11ea37f618c4758331f3f4ae9659a5509c05a1 /engine/lib
parent882866430efa4374206fc7289e2a7ab70ac5abf8 (diff)
parent8a79dc3904a2fda8081216fdf52be6a462db2709 (diff)
downloadelgg-e0b7270c6e770338259b1aa4bb919c81bb71eb13.tar.gz
elgg-e0b7270c6e770338259b1aa4bb919c81bb71eb13.tar.bz2
Merge pull request #6184 from Srokap/pr/6121
#5952 - fix infinite loop when disabling > 50 annotations or metadata
Diffstat (limited to 'engine/lib')
-rw-r--r--engine/lib/annotations.php6
-rw-r--r--engine/lib/metadata.php6
2 files changed, 10 insertions, 2 deletions
diff --git a/engine/lib/annotations.php b/engine/lib/annotations.php
index 124e67e0f..5e9b530de 100644
--- a/engine/lib/annotations.php
+++ b/engine/lib/annotations.php
@@ -249,9 +249,13 @@ function elgg_disable_annotations(array $options) {
if (!elgg_is_valid_options_for_batch_operation($options, 'annotations')) {
return false;
}
+
+ // if we can see hidden (disabled) we need to use the offset
+ // otherwise we risk an infinite loop if there are more than 50
+ $inc_offset = access_get_show_hidden_status();
$options['metastring_type'] = 'annotations';
- return elgg_batch_metastring_based_objects($options, 'elgg_batch_disable_callback', false);
+ return elgg_batch_metastring_based_objects($options, 'elgg_batch_disable_callback', $inc_offset);
}
/**
diff --git a/engine/lib/metadata.php b/engine/lib/metadata.php
index d2f8d4cd4..fdb1b85f6 100644
--- a/engine/lib/metadata.php
+++ b/engine/lib/metadata.php
@@ -333,9 +333,13 @@ function elgg_disable_metadata(array $options) {
}
elgg_get_metadata_cache()->invalidateByOptions('disable', $options);
+
+ // if we can see hidden (disabled) we need to use the offset
+ // otherwise we risk an infinite loop if there are more than 50
+ $inc_offset = access_get_show_hidden_status();
$options['metastring_type'] = 'metadata';
- return elgg_batch_metastring_based_objects($options, 'elgg_batch_disable_callback', false);
+ return elgg_batch_metastring_based_objects($options, 'elgg_batch_disable_callback', $inc_offset);
}
/**