Answers.Body: <p>With help from a friend, we guess it has something to do with default_pager_size.</p>
  <p>$this-&gt;setRowCount(\Civi::settings()-&gt;get('default_pager_size'));</p>
  <p>So i went to set the &quot;Default Search Pager size&quot; in &quot;Settings - Search Preferences&quot; to another value in an attempt to refresh the value and it worked. Dashlets are populating fine now.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-03-12T19:33:50.693Z
Answers.Text: Something like this has come up before but it wasn't reproducible. What normally happens with `\Civi::settings()->get` is it will pull the default from "metadata", in this case this line: https://github.com/civicrm/civicrm-core/blob/1754e1752eb8e516ec846a438005f6fcb55be247/settings/Search.setting.php#L242. But for some reason you were getting null instead of the default. Setting it on the settings page will then use that value, so that "fixes" it, but it's supposed to pick up the default from the file if you haven't set it on the settings page. Sometimes it just needs a cache clear.
Answers.UserDisplayName: Demerit
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-03-12T06:24:44.830Z
Answers.LastActivityDate: 2022-03-12T06:24:44.830Z
Answers.UserDisplayName: humanistsg
Body: <p>My site currently at 5.39.1, error did not occur at 5.35.2 .</p>
  <p>I'm getting an error loading the latest contribution / donor dashlets. The case and news dashlet loads without issues.</p>
  <p>Results are showing up fine at contributions dashboard <strong>wp-admin/admin.php?page=CiviCRM&amp;q=civicrm%2Fcontribute&amp;reset=1</strong></p>
  <p>I don't know why the getRowCount is null from the stacktrace below.</p>
  <p>Please advise?</p>
  <p><strong>CiviCRM error popup</strong>:</p>
  <pre><code>Network Error
  Unable to reach the server. Please refresh this page in your browser and try again.
  </code></pre>
  <p><strong>Traffic response</strong>:</p>
  <pre><code>500 Internal Server Error
  /wp-admin/admin.php?page=CiviCRM&amp;q=civicrm/report/instance/13&amp;reset=1&amp;section=2&amp;context=dashlet&amp;rowCount=10&amp;snippet=json
  </code></pre>
  <p><strong>Your Site is Experiencing a Technical Issue</strong> - automated email from Wordpress (i replaced the folder names as they are not relevant)</p>
  <pre><code>Error Details
  
  An error of type E_ERROR was caused in line 535 of the file /&lt;folder names&gt;/public_html/wp-content/plugins/civicrm/civicrm/CRM/Report/Form.php. 
  
  Error message: Uncaught TypeError: Return value of CRM_Report_Form::getRowCount() must be of the type int, null returned in /&lt;folder names&gt;/public_html/wp-content/plugins/civicrm/civicrm/CRM/Report/Form.php:535
  
  Stack trace:
  
  #0 /&lt;folder names&gt;/public_html/wp-content/plugins/civicrm/civicrm/CRM/Report/Form.php(3611): CRM_Report_Form-&gt;getRowCount()
  
  #1 /&lt;folder names&gt;/public_html/wp-content/plugins/civicrm/civicrm/CRM/Report/Form/Contribute/Detail.php(522): CRM_Report_Form-&gt;limit()
  
  #2 /&lt;folder names&gt;/public_html/wp-content/plugins/civicrm/civicrm/CRM/Report/Form.php(3586): CRM_Report_Form_Contribute_Detail-&gt;buildQuery()
  
  #3 /&lt;folder names&gt;/public_html/wp-content/plugins/civicrm/civicrm/CRM/Report/Form.php(930): CRM_Report_Form-&gt;postProcess()
  
  #4 /&lt;folder names&gt;/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Form.php(621): CRM_Report_Form-&gt;preProcess()
  
  #5 /&lt;folder names&gt;/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/QuickForm/Action/Display.php(76): CRM_Core_Form-&gt;buildForm()
  
  #6 /&lt;folder names&gt;/public_html/wp-co
  </code></pre>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-01-23T05:16:56.007Z
Comments.Text: Critical error also happens for other report instances /wp-admin/admin.php?page=CiviCRM&q=civicrm/report/instance/20
Comments.UserDisplayName: humanistsg
Tags: <contributions><dashlet>
Title: Contribution dashlet Network error / internal server 500 error / CRM_Report_Form::getRowCount() must be of the type int
ThreadText: # Contribution dashlet Network error / internal server 500 error / CRM_Report_Form::getRowCount() must be of the type int
  
  (Asked by: username_0 on 2022-01-23)
  
  My site currently at 5.39.1, error did not occur at 5.35.2 .
  I'm getting an error loading the latest contribution / donor dashlets. The case and news dashlet loads without issues.
  Results are showing up fine at contributions dashboard wp-admin/admin.php?page=CiviCRM&q=civicrm%2Fcontribute&reset=1
  I don't know why the getRowCount is null from the stacktrace below.
  Please advise?
  CiviCRM error popup:
  Network Error
  Unable to reach the server. Please refresh this page in your browser and try again.
  
  Traffic response:
  500 Internal Server Error
  /wp-admin/admin.php?page=CiviCRM&q=civicrm/report/instance/13&reset=1&section=2&context=dashlet&rowCount=10&snippet=json
  
  Your Site is Experiencing a Technical Issue - automated email from Wordpress (i replaced the folder names as they are not relevant)
  Error Details
  
  An error of type E_ERROR was caused in line 535 of the file //public_html/wp-content/plugins/civicrm/civicrm/CRM/Report/Form.php. 
  
  Error message: Uncaught TypeError: Return value of CRM_Report_Form::getRowCount() must be of the type int, null returned in //public_html/wp-content/plugins/civicrm/civicrm/CRM/Report/Form.php:535
  
  Stack trace:
  
  #0 //public_html/wp-content/plugins/civicrm/civicrm/CRM/Report/Form.php(3611): CRM_Report_Form->getRowCount()
  
  #1 //public_html/wp-content/plugins/civicrm/civicrm/CRM/Report/Form/Contribute/Detail.php(522): CRM_Report_Form->limit()
  
  #2 //public_html/wp-content/plugins/civicrm/civicrm/CRM/Report/Form.php(3586): CRM_Report_Form_Contribute_Detail->buildQuery()
  
  #3 //public_html/wp-content/plugins/civicrm/civicrm/CRM/Report/Form.php(930): CRM_Report_Form->postProcess()
  
  #4 //public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Form.php(621): CRM_Report_Form->preProcess()
  
  #5 //public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/QuickForm/Action/Display.php(76): CRM_Core_Form->buildForm()
  
  #6 //public_html/wp-co
  
  **Tags:** contributions, dashlet
  
  > **Comments:**
  > **username_0**: Critical error also happens for other report instances /wp-admin/admin.php?page=CiviCRM&q=civicrm/report/instance/20  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2022-03-12. Score: 1
  
  With help from a friend, we guess it has something to do with default\_pager\_size.
  
  $this->setRowCount(\Civi::settings()->get('default\_pager\_size'));
  
  So i went to set the "Default Search Pager size" in "Settings - Search Preferences" to another value in an attempt to refresh the value and it worked. Dashlets are populating fine now.
  
  > **Comments:**
  > **username_1**: Something like this has come up before but it wasn't reproducible. What normally happens with `\Civi::settings()->get` is it will pull the default from "metadata", in this case this line: https://github.com/civicrm/civicrm-core/blob/1754e1752eb8e516ec846a438005f6fcb55be247/settings/Search.setting.php#L242. But for some reason you were getting null instead of the default. Setting it on the settings page will then use that value, so that "fixes" it, but it's supposed to pick up the default from the file if you haven't set it on the settings page. Sometimes it just needs a cache clear.  
  
  ---
  
  