title: Ho to set a default query parameter in cakephp 3.6?
body: <p>I have a classical index page with a form where I can filter my records.</p>
  
  <p>One of my fields is <code>year</code>. Let's say that I want the records to be pre-filtered by current year when the user first visit the page (i.e. when the query string is empty)</p>
  
  <p><strong>what have I done:</strong></p>
  
  <p>in my controller I did something like this</p>
  
  <pre><code>if(empty($this-&gt;request-&gt;query))
  {
      $this-&gt;request-&gt;query['year'] =  date('Y');
  }
  </code></pre>
  
  <p>and then with the help of friendsofcake/search plugig: </p>
  
  <pre><code>$this-&gt;MyTable-&gt;find('search', [
      'search' =&gt; $this-&gt;request-&gt;getQuery()
  ]);
  </code></pre>
  
  <p>In this way the records are filtered and the form is pre compiled with the current year since in my view I have</p>
  
  <pre><code>'valueSources' =&gt; 'query'
  </code></pre>
  
  <p>Now with cake 3.6 direct modification of the query is deprecated (see <a href="https://github.com/cakephp/cakephp/issues/11966" rel="nofollow noreferrer"><strong>this</strong></a> issue I opened). In fact I get deprecation warnings when I try to change the query array.</p>
  
  <p><strong>My question:</strong></p>
  
  <p>So I want to know what is the best way to achieve the same behavior without getting warnings. I would also like to know if and why my approach is wrong.</p>