Posted by ru.meta on September 29, 2009 at 12:18pm
Jump to:
| Project: | Prepopulate |
| Version: | 6.x-1.1 |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Issue Summary
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 useedit[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
#1
#2
With 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.