I've tried to populate user roles from url
/admin/user/user/create?edit[account][roles]=7
and found that #default_value replaced with string. Also I tried to use
edit[account][roles][]=7
with no success.
The solution I found is to replace
$form['#default_value'] = $getslice;
with
if (is_array($form['#default_value'])) {
$form['#default_value'][] = $getslice;
} else {
$form['#default_value'] = $getslice;
} Is there better way?
Comments
Comment #1
ru.meta commentedComment #2
MadOverlord commentedWith taxonomy select boxes (not checkboxes), at least, you can do multiple select:
node/add/product?edit[taxonomy][3][]=11&edit[taxonomy][3][]=10
and single select like this:
node/add/product?edit[taxonomy][3]=11
I don't know if this will be helpful for checkboxes though.
Comment #3
jbrauer commentedClosing D6 issues as it's no longer supported.