aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engine/lib/annotations.php4
-rw-r--r--engine/lib/elgglib.php2
-rw-r--r--engine/lib/metadata.php4
-rw-r--r--engine/tests/api/metastrings.php6
4 files changed, 11 insertions, 5 deletions
diff --git a/engine/lib/annotations.php b/engine/lib/annotations.php
index 5049d455b..f32dee0f0 100644
--- a/engine/lib/annotations.php
+++ b/engine/lib/annotations.php
@@ -209,9 +209,11 @@ function elgg_get_annotations(array $options = array()) {
* Deletes annotations based on $options.
*
* @warning Unlike elgg_get_annotations() this will not accept an empty options array!
+ * This requires at least one constraint: annotation_owner_guid(s),
+ * annotation_name(s), annotation_value(s), or guid(s) must be set.
*
* @param array $options An options array. {@See elgg_get_annotations()}
- * @return mixed
+ * @return mixed Null if the metadata name is invalid. Bool on success or fail.
* @since 1.8.0
*/
function elgg_delete_annotations(array $options) {
diff --git a/engine/lib/elgglib.php b/engine/lib/elgglib.php
index 38ae73d82..5a8c89a56 100644
--- a/engine/lib/elgglib.php
+++ b/engine/lib/elgglib.php
@@ -1970,7 +1970,7 @@ function elgg_is_valid_options_for_batch_operation($options, $type) {
// at least one of these is required.
$required = array(
// generic restraints
- 'guid', 'guids', 'limit'
+ 'guid', 'guids'
);
switch ($type) {
diff --git a/engine/lib/metadata.php b/engine/lib/metadata.php
index f543c0fd0..012c73ad9 100644
--- a/engine/lib/metadata.php
+++ b/engine/lib/metadata.php
@@ -294,8 +294,8 @@ function elgg_get_metadata(array $options = array()) {
* Deletes metadata based on $options.
*
* @warning Unlike elgg_get_metadata() this will not accept an empty options array!
- * This requires at least one constraints: metadata_owner_guid(s),
- * metadata_name(s), metadata_value(s), guid(s), or limit must be set.
+ * This requires at least one constraint: metadata_owner_guid(s),
+ * metadata_name(s), metadata_value(s), or guid(s) must be set.
*
* @param array $options An options array. {@see elgg_get_metadata()}
* @return mixed Null if the metadata name is invalid. Bool on success or fail.
diff --git a/engine/tests/api/metastrings.php b/engine/tests/api/metastrings.php
index a96388217..0a8945084 100644
--- a/engine/tests/api/metastrings.php
+++ b/engine/tests/api/metastrings.php
@@ -132,7 +132,7 @@ class ElggCoreMetastringsTest extends ElggCoreUnitTest {
public function testKeepMeFromDeletingEverything() {
foreach ($this->metastringTypes as $type) {
$required = array(
- 'guid', 'guids', 'limit'
+ 'guid', 'guids'
);
switch ($type) {
@@ -160,6 +160,10 @@ class ElggCoreMetastringsTest extends ElggCoreUnitTest {
$options = array();
$this->assertFalse(elgg_is_valid_options_for_batch_operation($options, $type));
+ // limit alone isn't valid:
+ $options = array('limit' => 10);
+ $this->assertFalse(elgg_is_valid_options_for_batch_operation($options, $type));
+
foreach ($required as $key) {
$options = array();