Please help with reports and parameters

Silverstripe Version: 4.2


I am trying to build some reports but wondering about the correct way to go with using parameters. I have the following code in my report:

class MemberReport extends Report

   public function parameterFields()
        $fields = FieldList::create(
            $start = DateField::create('StartPeriod', 'Start Date'),
            $end = DateField::create('EndPeriod', 'End Date')
	    return $fields;

   public function sourceRecords($params = null)

Now my question is how do I correctly access those parameters? Debug is showing nothing. I can see them if I use the request in the current controller but I would have thought they should appear in the $params variable. Is the report supposed to post the filter by GET or POST? Mine is using GET (querystring).

Documentation and examples are a bit thin here. Can anyone please provide an example or instruction to help point me in the right direction.

Thank you kindly.

After further investigation I have narrowed down the problem to this bit of code in the Report class:

        if (Injector::inst()->has(HTTPRequest::class)) {
            /** @var HTTPRequest $request */
            $request = Injector::inst()->get(HTTPRequest::class);
            $params = $request->param('filters') ?: [];

it is not loading $param with anything so a potential bug maybe. Can anyone confirm this is working for them?

For my report I will just grab the params myself.