Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-77293

Array parameters should be consistently supported in moodle_url

XMLWordPrintable

      There is a weird anomaly in moodle_url.

      If you create an like this:

      new \moodle_url('http://example.com/?tags[]=123&tags[]=456');
      new \moodle_url('http://example.com/?tags[0]=123&tags[1]=456');
      

      then that works, with $this->params['tags'] being set to ['123', '456']. And, there is code in get_query_string() which ensures this is handled right when the URL is output (and MDL-77148 is adding export_params_for_template).

      However, if you try to do

      new \moodle_url('http://example.com/', ['tags' => ['123', '456']]);
      

      then you get a coding_exception telling you not to.

      Since this acutally works, I think we should stop rejecting it in params() method (while adding PHPunit coverage to verify that everything works).

            matthewhilton Matthew Hilton
            timhunt Tim Hunt
            Kevin Pham Kevin Pham
            Andrew Lyons Andrew Lyons
            CiBoT CiBoT
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.