Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The user form has a prefill but field where not applied as they should. So here is my patch in the next comment.
Comment | File | Size | Author |
---|---|---|---|
#1 | 1450664-prefill-user-form.patch | 2.04 KB | matglas86 |
Comments
Comment #1
matglas86 CreditAttribution: matglas86 commentedComment #2
Frans CreditAttribution: Frans commentedWhy do you force the field type to be a texfield?
$form['account'][$sync_with]['#type'] == 'textfield'
The value is probably text, but the field can be a textarea, checkboxes or even a list (think 'gender' for example).
I do think it can be complicated, so I agree with the alter functions you introduce, but I think that the forced field type has to go. The detection on the 'value' key was not perfect either, but left room for all kinds of field types.
Comment #3
matglas86 CreditAttribution: matglas86 commentedSo this needs work? Will do that... patch will come.
Comment #4
Frans CreditAttribution: Frans commentedDid a first fix on this.
I changed the alters to one alter call at the end of the function. I don't see why 2 alters for each field is needed (resources).
It is far from complete, but does its job already a lot better.
See also #1481574: Integration with feeds for some new insights.
Comment #5
dxx CreditAttribution: dxx commentedNo problems to report.
+1 for add the hook at the end.