- 🇨🇦Canada joelpittet Vancouver
It looks like something changed the useage needs a value of 'true' now
prepopulate/src/Populate.php:137
case 'checkbox': $form['#checked'] = $value === 'true';
So that would be
edit[field_name][widget][123]=true
Hello,
I was trying to pre-populate a (taxonomy term) entity reference field that uses a radio widget and took me a few hours of debugging, so I'm posting my solution here.
1) You need to implement the hook_prepopulate_whitelist_alter() and whitelist both the radios and the radio element type. If you only whitelist the radios, which is the obvious solution, it will not work.
2) The query string for your field should be: edit[field_name][widget][123]=123
, where "field_name" is the machine name of your field, and 123
is the id of the referenced entity (in my case: the term id).
Needs review
2.0
Documentation
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
It looks like something changed the useage needs a value of 'true' now
prepopulate/src/Populate.php:137
case 'checkbox':
$form['#checked'] = $value === 'true';
So that would be
edit[field_name][widget][123]=true