The Entity reference autofill module gives Entity reference fields an option to populate other form fields with data from selected referenced entities.

Installation

Upload and install as normal.

This module depends on the Entity reference module.

Configuration

  • 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.

Limitations

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.

Compability

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 #2230567: Getlocations problem - creating new map instead of updating existing one.

State API (Conditional fields): #2217559: Conflict with conditional field module: unhide hidden fields

Sponsors

Initial development sponsored by Pool Interactive.

Project Information

Downloads