Details
-
Type:
Bug
-
Status:
Open
-
Priority:
Minor
-
Resolution: Unresolved
-
Affects Version/s: 1.9.4, 2.0
-
Fix Version/s: STABLE backlog
-
Component/s: Forms Library
-
Labels:None
-
Affected Branches:MOODLE_19_STABLE, MOODLE_20_STABLE
Description
what gets returned after the form is submitted looks like this:
Array (
[filepath[0]] =>
[filepath[1]] =>
[filepath[2]] =>
)
rather than
Array(
filepath => array
0 =>
1 =>
2 =>
)
)
I guess because the form element appends [value] to the name, so the formname is filepath[0][value]
Activity
- All
- Comments
- History
- Activity
- Source
- Test Sessions
I changed my validation method to accept $data by reference and put the following in which seems to fix it:
$data['filepath'] = array();
foreach (array_keys($data['mediaid']) as $key) { $data['filepath'][$key] = $data['filepath[' . $key . ']']; unset($data['filepath[' . $key . ']']); }
but this should be fixed either in repeat elements or in the form element, not sure which.