Answers.Body: <p>This sounds like it might be a bug in the expenses extension. It's hitting <a href="https://lab.civicrm.org/extensions/expenses/-/blob/e07563be5c1339e827931e686f22a48edf945df4/CRM/Expenses/Form/Expense.php#L121" rel="nofollow noreferrer">line 121</a> in CRM/Expenses/Form/Expense.php but <code>$this-&gt;_expense</code> is a string instead of an array at that point.</p>
  <p>It's not clear why it's a string - it gets set at <a href="https://lab.civicrm.org/extensions/expenses/-/blob/e07563be5c1339e827931e686f22a48edf945df4/CRM/Expenses/Form/Expense.php#L46" rel="nofollow noreferrer">line 46</a> - if you add something like <code>CRM_Core_Error::debug_log_message(var_export($this-&gt;_expense, true));</code> either at line 48 or at line 120 and then check in the <a href="https://civicrm.stackexchange.com/a/15932/181">ConfigAndLog</a> file it will tell you what it looks like.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-03-28T05:36:45.273Z
Answers.Text: Below is the error log i got from ConfigAndLog:>
  
  
  Mar 27 12:08:30  [info] Creating canary table
  
  
  Mar 27 12:08:43  [warning] Deprecated function CRM_Core_BAO_Setting::setItem, use refer docs for correct methods https://docs.civicrm.org/dev/en/latest/framework/setting/.
  Array
  (
      [civi.tag] => deprecated
  )
  
  Mar 28 05:34:02  [info] 'Expense'
Answers.UserDisplayName: HRAC
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-03-28T05:53:07.857Z
Answers.Text: I attached a screenshot of the log in the post >Mar 28 05:46:43  [info] 'Expense'
Answers.UserDisplayName: HRAC
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-03-28T06:22:04.380Z
Answers.Text: Ok great so that's confirming it's the literal string 'Expense' instead of an array. That's weird.
Answers.UserDisplayName: Demerit
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-03-28T08:05:50.480Z
Answers.Text: What should i do?
   Is there any part of the code need to change?
Answers.UserDisplayName: HRAC
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-03-28T13:49:51.130Z
Answers.Text: Do you have anything in the civicrm_expense database table that looks weird?
Answers.UserDisplayName: Demerit
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-03-28T16:53:19.500Z
Answers.Text: I added a screenshot of the database on the post. 
  I do not see anything weird.
Answers.UserDisplayName: HRAC
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-03-28T03:24:14.673Z
Answers.LastActivityDate: 2021-03-28T03:24:14.673Z
Answers.UserDisplayName: Demerit
Body: <p>Having trouble to figure out whats wrong with the edit expense function as it always return a blank page. What could be the issue?</p>
  <p>I extracted the error code from the error log.</p>
  <p><a href="https://i.sstatic.net/jpAiu.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/jpAiu.png" alt="enter image description here" /></a></p>
  <p><a href="https://i.sstatic.net/qYEz4.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/qYEz4.png" alt="enter image description here" /></a></p>
  <p><a href="https://i.sstatic.net/xfaAh.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/xfaAh.png" alt="enter image description here" /></a></p>
  <p>My setup environment:
  Wordpress
  Civicrm 5.35.1</p>
  <p><a href="https://i.sstatic.net/mPBrp.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/mPBrp.png" alt="Blank page shown when trying to edit" /></a></p>
  <p><a href="https://i.sstatic.net/Y7PKE.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/Y7PKE.png" alt="After clicking edit button" /></a></p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-03-27T13:57:37.533Z
Comments.Text: To be sure, you mean this extension https://lab.civicrm.org/extensions/expenses ?
Comments.UserDisplayName: Kainuk - CiviCooP
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-03-27T14:21:22.987Z
Comments.Text: A network error usually hides another error. When you disable popup screens (Can be done at https://<server>/civicrm/admin/setting/preferences/display?reset=1 and look for enable popup, and uncheck), the real error is shown.
Comments.UserDisplayName: Kainuk - CiviCooP
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-03-28T00:01:57.053Z
Comments.Text: Try opening the page/form on a new tab
Comments.UserDisplayName: Pradeep Nayak
Tags: <civicase><administer>
Title: Civicrm - Expense extension [unable to edit expenses]
ThreadText: # Civicrm - Expense extension [unable to edit expenses]
  
  (Asked by: username_0 on 2021-03-27)
  
  Having trouble to figure out whats wrong with the edit expense function as it always return a blank page. What could be the issue?
  
  I extracted the error code from the error log.
  
  [![enter image description here](https://i.sstatic.net/jpAiu.png)](https://i.sstatic.net/jpAiu.png)
  
  [![enter image description here](https://i.sstatic.net/qYEz4.png)](https://i.sstatic.net/qYEz4.png)
  
  [![enter image description here](https://i.sstatic.net/xfaAh.png)](https://i.sstatic.net/xfaAh.png)
  
  My setup environment:
  Wordpress
  Civicrm 5.35.1
  
  [![Blank page shown when trying to edit](https://i.sstatic.net/mPBrp.png)](https://i.sstatic.net/mPBrp.png)
  
  [![After clicking edit button](https://i.sstatic.net/Y7PKE.png)](https://i.sstatic.net/Y7PKE.png)
  
  **Tags:** civicase, administer
  
  > **Comments:**
  > **username_1**: To be sure, you mean this extension https://lab.civicrm.org/extensions/expenses ?  
  > **username_1**: A network error usually hides another error. When you disable popup screens (Can be done at https://<server>/civicrm/admin/setting/preferences/display?reset=1 and look for enable popup, and uncheck), the real error is shown.  
  > **username_2**: Try opening the page/form on a new tab  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_3 on 2021-03-28. Score: 1
  
  This sounds like it might be a bug in the expenses extension. It's hitting [line 121](https://lab.civicrm.org/extensions/expenses/-/blob/e07563be5c1339e827931e686f22a48edf945df4/CRM/Expenses/Form/Expense.php#L121) in CRM/Expenses/Form/Expense.php but `$this->_expense` is a string instead of an array at that point.
  
  It's not clear why it's a string - it gets set at [line 46](https://lab.civicrm.org/extensions/expenses/-/blob/e07563be5c1339e827931e686f22a48edf945df4/CRM/Expenses/Form/Expense.php#L46) - if you add something like `CRM_Core_Error::debug_log_message(var_export($this->_expense, true));` either at line 48 or at line 120 and then check in the [ConfigAndLog](https://civicrm.stackexchange.com/a/15932/181) file it will tell you what it looks like.
  
  > **Comments:**
  > **username_0**: Below is the error log i got from ConfigAndLog:>   Mar 27 12:08:30  [info] Creating canary table   Mar 27 12:08:43  [warning] Deprecated function CRM_Core_BAO_Setting::setItem, use refer docs for correct methods https://docs.civicrm.org/dev/en/latest/framework/setting/. Array (     [civi.tag] => deprecated )  Mar 28 05:34:02  [info] 'Expense'  
  > **username_0**: I attached a screenshot of the log in the post >Mar 28 05:46:43  [info] 'Expense'  
  > **username_3**: Ok great so that's confirming it's the literal string 'Expense' instead of an array. That's weird.  
  > **username_0**: What should i do?  Is there any part of the code need to change?  
  > **username_3**: Do you have anything in the civicrm_expense database table that looks weird?  
  > **username_0**: I added a screenshot of the database on the post.  I do not see anything weird.  
  
  ---
  
  