summaryrefslogtreecommitdiff
path: root/modules/field/tests/field_test.field.inc
diff options
context:
space:
mode:
authorwebchick <webchick@24967.no-reply.drupal.org>2012-01-21 09:52:47 -0800
committerwebchick <webchick@24967.no-reply.drupal.org>2012-01-21 09:52:47 -0800
commit0736fbb14bb42e0e8c9d6583501fa93ea7ad58c2 (patch)
treeecbac92847a44bcdd782494059b21ced568ede22 /modules/field/tests/field_test.field.inc
parenta75b69734c216a404b57446ec939283eb6ab162d (diff)
downloadbrdo-0736fbb14bb42e0e8c9d6583501fa93ea7ad58c2.tar.gz
brdo-0736fbb14bb42e0e8c9d6583501fa93ea7ad58c2.tar.bz2
Issue #1371938 by yched, Everett Zufelt, xjm, casey: Fixed hook_field_delete() no longer invoked during field_purge_data().
Diffstat (limited to 'modules/field/tests/field_test.field.inc')
-rw-r--r--modules/field/tests/field_test.field.inc30
1 files changed, 30 insertions, 0 deletions
diff --git a/modules/field/tests/field_test.field.inc b/modules/field/tests/field_test.field.inc
index 6d03855c6..cc76a998d 100644
--- a/modules/field/tests/field_test.field.inc
+++ b/modules/field/tests/field_test.field.inc
@@ -58,6 +58,9 @@ function field_test_field_update_forbid($field, $prior_field, $has_data) {
* Implements hook_field_load().
*/
function field_test_field_load($entity_type, $entities, $field, $instances, $langcode, &$items, $age) {
+ $args = func_get_args();
+ field_test_memorize(__FUNCTION__, $args);
+
foreach ($items as $id => $item) {
// To keep the test non-intrusive, only act for instances with the
// test_hook_field_load setting explicitly set to TRUE.
@@ -73,12 +76,39 @@ function field_test_field_load($entity_type, $entities, $field, $instances, $lan
}
/**
+ * Implements hook_field_insert().
+ */
+function field_test_field_insert($entity_type, $entity, $field, $instance, $items) {
+ $args = func_get_args();
+ field_test_memorize(__FUNCTION__, $args);
+}
+
+/**
+ * Implements hook_field_update().
+ */
+function field_test_field_update($entity_type, $entity, $field, $instance, $items) {
+ $args = func_get_args();
+ field_test_memorize(__FUNCTION__, $args);
+}
+
+/**
+ * Implements hook_field_delete().
+ */
+function field_test_field_delete($entity_type, $entity, $field, $instance, $items) {
+ $args = func_get_args();
+ field_test_memorize(__FUNCTION__, $args);
+}
+
+/**
* Implements hook_field_validate().
*
* Possible error codes:
* - 'field_test_invalid': The value is invalid.
*/
function field_test_field_validate($entity_type, $entity, $field, $instance, $langcode, $items, &$errors) {
+ $args = func_get_args();
+ field_test_memorize(__FUNCTION__, $args);
+
foreach ($items as $delta => $item) {
if ($item['value'] == -1) {
$errors[$field['field_name']][$langcode][$delta][] = array(