The Entity reference autofill module gives Entity reference fields an option to populate other form fields with data from selected referenced entities.
Upload and install as normal.
This module depends on the Entity reference module.
- First, you need to add a field you want to be auto-filled to your entity (destination).
- If you plan to load the referenced values from another entity type or bundle, you will need to add another instance of the same field to the referenced entity (source).
- When you have set up both a source and destination field (two instances of the same field), add an entityreference field to the destination entity. Currently supported widgets are autocomplete, select list and radio buttons. A sub-module for the OG widget is also provided. Note that the field can only have one value, ie multi-value fields wont work.
- Now, in the reference field's instance settings, enable "Entity reference autofill" under "Additional behaviors". Select the fields you wish to fetch from the referenced entity.
- Optionally, unselect "Overwrite existing data" if you want to preserve field data already entered before selecting referenced entity.
- Go to the entity form and try it out by loading a value into the reference field.
- If you use a default reference value, or use the Entityreference prepopulate module, the configured fields will be prepopulated on form load.
The module only works for reference fields with a single value, since there is no way (?) of knowing what referenced data to return for multi-value reference fields. If you have a suggested solution for this, feel free to post an issue in the issue queue.
This module should work out of the box for most fields. API hooks are available to add extended field support. For more information, see the api documentation provided with the module. If a field does not work as expected, please post an issue in the issue queue.
Known compability issues / bugs
Currently known issues (and, if found, solutions) are listed below. Consider this list when deciding whether or not to use this module. Also, feel free to help out resolving open issues!
Addressfield: Addressfield needs some additional processing in order to be loaded. A sub-module is included to make it work. Enable "Entity reference autofill addressfield" and you're good to go.
Get Locations: Issue .
State API (Conditional fields):
Initial development sponsored by Pool Interactive.
- Maintenance status: Actively maintained
- Development status: Maintenance fixes only
- Module categories: Content, Fields
- Reported installs: 1,581 sites currently report using this module. View usage statistics.
- Downloads: 8,340
- Last modified: December 2, 2014
- Stable releases for this project are covered by the security advisory policy.
Look for the shield icon below.