title: Yii2 gridView broken pagination
body: <p>I have bootstrap modal with gridview in it. Pagination for dataProvider is set to 5. The problem is that I have only 1 row on the first page of my gridview, other pages seems to work good.
  Here's gridview code </p>
  
  <pre><code> &lt;?php Pjax::begin(); ?&gt;
  &lt;?= GridView::widget([
                      'dataProvider' =&gt; $operations,
                      'filterModel'=&gt;$fModel,
                      'columns' =&gt; [
                          'operation_code',
                          'amount',
                          [
                              'attribute'=&gt;'type',
                              'content'=&gt;function($model){
                                return ClientMoneyOperation::itemAlias('type_color',$model-&gt;type);
                              },
                              'filter'=&gt;ClientMoneyOperation::itemAlias('type'),
                          ],
                          [
                              'header'=&gt;'Бонус',
                              'content'=&gt;function($model){
                                  return $model-&gt;bonus-&gt;amount;
                              }
                          ],
                          [
                              'header'=&gt;'Директорський бонус',
                              'content'=&gt;function($model){
                                  return $model-&gt;directorbonus;
                              }
                          ],
                          'comment',
                          [
                              'attribute'=&gt;'created_at',
                              'format'=&gt;'datetime',
                              'filter'=&gt;false],
  
                      ]
                  ]) ?&gt;
                  &lt;?php Pjax::end(); ?&gt;
  </code></pre>
  
  <p>and search function </p>
  
  <pre><code> public function 
   search($params,$city_id=null,$client_id=null,$page_size=20,$group = 
   false,$code=null,$date_from = null){
      if($city_id){
          $query = ClientMoneyOperation::find()-&gt;joinWith(['user.place'])-
  &gt;where(['place.city_id'=&gt;$city_id]);
      } else {
          $query = ClientMoneyOperation::find();
  }
  
  $query-&gt;joinWith(['client'])-&gt;joinWith(['bonus']);
  if($group){
          $query-&gt;groupBy('operation_code');
  }
      $query-&gt;orderBy('created_at DESC');
  if($code){
      $query-&gt;where(['operation_code'=&gt;$code]);
  }
      $dataProvider = new ActiveDataProvider([
          'query'=&gt;$query,
          'sort'=&gt;['attributes'=&gt;['created_at'=&gt;SORT_DESC]],
          'pagination'=&gt;[
              'pageSize'=&gt;$page_size
          ],
      ]);
  
      $this-&gt;load($params);
  
      if(!$this-&gt;validate()){
          return $dataProvider;
      }
      $query-&gt;andFilterWhere([
          'client_money_operation.type'=&gt;$this-&gt;type,
          'client_money_operation.status'=&gt;$this-&gt;status,
      ]);
      if($client_id){
          $query-&gt;andFilterWhere([
          'client_money_operation.client_id'=&gt;$client_id,
      ]);
      }
  
      $query-&gt;andFilterWhere(['like','client_money_operation.comment',$this-&gt;comment])
            -&gt;andFilterWhere(['like','client.card_code',$this-&gt;card_code])
            -&gt;andFilterWhere(['like','client_bonus_operation.amount',$this-&gt;bonus_amount])
            -&gt;andFilterWhere(['like','client_money_operation.operation_code',$this-&gt;operation_code]);
      if(!empty($this-&gt;created_at_range) &amp;&amp; strpos($this-&gt;created_at_range, '-') !== false){
          list($start_date, $end_date) = explode(' - ', $this-&gt;created_at_range);
          $query-&gt;andFilterWhere(['between', 'client_money_operation.created_at', strtotime(date("Y-m-d",strtotime($start_date))), strtotime(date("Y-m-d",strtotime($end_date)+86400))]);
      } else {
          $query-&gt;andFilterWhere(['between', 'client_money_operation.created_at', $date_from != null ? 1 : strtotime(date("Y-m-d",time())), strtotime(date("Y-m-d",time() + 86400))]);
      }
      return $dataProvider;
  }
  </code></pre>
  
  <p>other gridviews works ok with the same dataprovider. PageSize 5 is setted in controller, where I am calling function <code>search()</code></p>