-
Bug
-
Resolution: Duplicate
-
Minor
-
None
-
2.6
-
None
-
MOODLE_26_STABLE
If you pass an array as one of the params to moodle_url params() function, the exception "Coding error detected, it must be fixed by a programmer: Url parameters values can not be arrays!" is thrown.
This relates to MDL-29161. In the comments https://tracker.moodle.org/browse/MDL-29161?focusedCommentId=148346&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-148346 skodak asks where there is a usecase for moodle_url params() function to accept arrays.
Here's what I'm trying to do.
I have a form which controls the data being output in a report in a flexible table. The table should be pageable and downloadable. For those facilities to work, I need to set the base url for the table to include the form parameters.
I'm trying $currentpage->params((array)$mform->get_data()))
However, one of my form fields is a multi select box, which becomes an array of values, so the params call fails.
In discussion with timhunt he has a similar requirement in quiz reports.
The work around is to implode the array into a text string to pass as a single param, and then ensure all code handles the param as an array or a text string. But that's rather clunky.
It would be great if moodle_url could handle this situation without workarounds.
- will be (partly) resolved by
-
MDL-33188 improve moodle_url URL string parsing
- Closed