During testing of autofill, I have noticed, that it's not possible to have two groups of autofill fields.

For example:

field_one => to be source for field_one_clone
field_two => to be source for field_two_clone

I think that a feature like this would be valuable.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mtodor created an issue. See original summary.

mtodor’s picture

Version: 8.x-1.0-alpha1 » 8.x-1.x-dev
szeidler’s picture

Status: Active » Needs review
FileSize
9.76 KB

Thanks for your input.

You're right. The reason is, that we only had a single variable var target_field_was_manipulated, that state if a target was manipulated. Actually this needs to be handled per target field.

I changed the javascript to be able to do that. I adopted also your scenario in the tests.

Thanks for a review.

bernardm28’s picture

Does this allow autofill from two sources? For example if one wants to autofill from the Firstname and Lastname fields.

chr.fritsch’s picture

Status: Needs review » Needs work

I checked the patch and found one small problem.

I have 4 fields: one, one_clone, two and two_clone.

one is mapped to one_clone and two to two_clone.

I type something in one_clone and then into one. No overwrite of one_clone, fine.
I type something into two and nothing is copied to two_clone. That should be because two_clone is still empty.

chr.fritsch’s picture

Status: Needs work » Needs review
FileSize
1.99 KB
10.07 KB

I extended the test and fixed the bug I found.

volkerk’s picture

Status: Needs review » Reviewed & tested by the community

I manually tested this using one source and multiple targets and also chaining multiple fields. Works as expected.

  • szeidler committed 83b6781 on 8.x-1.x authored by chr.fritsch
    Issue #3106856 by chr.fritsch, szeidler: Multiple autofill fields on...
szeidler’s picture

Status: Reviewed & tested by the community » Fixed

I tested patch #6 as well. Thanks for spotting and fixing the bug. It looks alright for me now and got committed.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.