function field_test_default_value

Same name in other branches
  1. 9 core/modules/field/tests/modules/field_test/field_test.field.inc \field_test_default_value()
  2. 8.9.x core/modules/field/tests/modules/field_test/field_test.field.inc \field_test_default_value()
  3. 10 core/modules/field/tests/modules/field_test/field_test.field.inc \field_test_default_value()
  4. 11.x core/modules/field/tests/modules/field_test/field_test.field.inc \field_test_default_value()

Sample 'default value' callback.

1 call to field_test_default_value()
FieldAttachStorageTestCase::testFieldAttachSaveMissingDataDefaultValue in modules/field/tests/field.test
Test insert with missing or NULL fields, with default value.
1 string reference to 'field_test_default_value'
FieldAttachStorageTestCase::testFieldAttachSaveMissingDataDefaultValue in modules/field/tests/field.test
Test insert with missing or NULL fields, with default value.

File

modules/field/tests/field_test.field.inc, line 401

Code

function field_test_default_value($entity_type, $entity, $field, $instance) {
    return array(
        array(
            'value' => 99,
        ),
    );
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.