Answers.Body: <p>I'm surprised you were able to get the "Update Greetings" scheduled job to run in cron; the UI specifically disallows enabling that job.  Did you turn it directly using SQL?  You may want to consider whether you really want that job enabled.</p>
  
  <p>That aside - I'd put this line just above line 1470:</p>
  
  <pre><code>print_r(CRM_Utils_Array::value($key, $greetingToken), TRUE)
  </code></pre>
  
  <p>And see what you get when you run the cli command manually.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-05-06T01:27:01.933Z
Answers.Text: I now get the error:   Parse error: syntax error, unexpected '$props' (T_VARIABLE) in /home/site/public_html/administrator/components/com_civicrm/civicrm/CRM/Utils/Token.php on line 1471
Answers.UserDisplayName: Hudson Essex Terraplane Club
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-05-06T04:13:12.750Z
Answers.Text: Did you add a semi-colon to the end of the statement?
Answers.UserDisplayName: Jon G - Megaphone Tech
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-05-06T21:14:28.947Z
Answers.Text: Thanks, after I added the semi-colon I got the same error:                         Warning: array_flip() expects parameter 1 to be array, string given in /home/site/public_html/administrator/components/com_civicrm/civicrm/CRM/Utils/Token.php on line 1471
  
  Warning: array_keys() expects parameter 1 to be array, null given in /home/site/public_html/administrator/components/com_civicrm/civicrm/CRM/Utils/Token.php on line 1472
Answers.UserDisplayName: Hudson Essex Terraplane Club
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-05-06T21:14:34.907Z
Answers.Text: Warning: array_fill_keys() expects parameter 1 to be array, null given in /home/site/public_html/administrator/components/com_civicrm/civicrm/CRM/Utils/Token.php on line 1472
  
  Fatal error: Unsupported operand types in /home/site/public_html/administrator/components/com_civicrm/civicrm/CRM/Utils/Token.php on line 1473
Answers.UserDisplayName: Hudson Essex Terraplane Club
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-05-06T22:00:56.870Z
Answers.Text: Are you running the command outside of cron?  If so, I would expect that you would also receive some additional info that you weren't getting before you added that code.
Answers.UserDisplayName: Jon G - Megaphone Tech
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-05-08T02:26:42.390Z
Answers.Text: I guess I have never done that.  I guess I need to research it and take a look at what additional info I get back.
Answers.UserDisplayName: Hudson Essex Terraplane Club
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-05-29T13:40:09.190Z
Answers.Text: An additional observation.  So all my cron jobs inside CiviCRM are running, however I have noticed that Scheduled Reminders is not working.  It shows that it ran but with no success.  When I run it manually, it shows "Success (1)".  So it looks like the token.php error is only affecting the automated running of the Schedule Reminder job but the job runs from inside CiviCRM manually.  Anybody have a clue how this would happen?  Getting tired of having to remember to run the scheduled reminder job everyday.
Answers.UserDisplayName: Hudson Essex Terraplane Club
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-05-29T14:44:45.153Z
Answers.Text: Sorry if my last comment was ambiguous.  When I said, "run the command out of cron", I meant, "Take the command that cron is running, and run it on an interactive command line."  You should see more info than is available when the same command runs via cron.
Answers.UserDisplayName: Jon G - Megaphone Tech
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-05-04T22:48:55.440Z
Answers.LastActivityDate: 2015-05-04T22:48:55.440Z
Answers.UserDisplayName: Jon G - Megaphone Tech
Answers.Body: <p>this bug seems to be related to a bug regarding tokens array structure some lines above. The array is being reduced to only one of it's values. Maybe this will work:</p>
  
  <p>See: <a href="https://issues.civicrm.org/jira/browse/CRM-17038" rel="nofollow">https://issues.civicrm.org/jira/browse/CRM-17038</a></p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-08-18T11:45:25.567Z
Answers.LastActivityDate: 2015-08-18T11:45:25.567Z
Answers.UserDisplayName: nielo
Answers.Body: <p>I'm also receiving the error: -
  Fatal error: Unsupported operand types in /home/accountname/public_html/sites/all/modules/civicrm/CRM/Utils/Token.php on line 1472</p>
  
  <p>However, the site is running 4.6.10 so shouldn't it be resolved?</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-12-13T21:36:48.087Z
Answers.Text: If you look at Nielo's comment above, the Jira ticket is closed but the fix is scheduled for 4.7 and we are still on 4.6.10.  We just have to wait until January I guess.  Until then the patch works.
Answers.UserDisplayName: Hudson Essex Terraplane Club
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-12-14T15:54:38.777Z
Answers.Text: Thanks Hudson, I've applied the patch and it does fix the error.
Answers.UserDisplayName: Jon-man
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-12-12T16:22:59.397Z
Answers.LastActivityDate: 2015-12-12T16:22:59.397Z
Answers.UserDisplayName: Jon-man
Body: <p>I keep getting a error daily for one of my cron jobs: </p>
  
  <pre><code>Cron &lt;site@prefix&gt; /usr/local/bin/php /home/site/public_html/administrator/components/com_civicrm/civicrm/bin/cli.php -s www.site.org -u adminusername -p adminpassword -e job -a execute
  </code></pre>
  
  <p>The error comes in an email and looks like this:</p>
  
  <pre><code>Warning: array_flip() expects parameter 1 to be array, string given in /home/site/public_html/administrator/components/com_civicrm/civicrm/CRM/Utils/Token.php on line 1470
  
  Warning: array_keys() expects parameter 1 to be array, null given in /home/site/public_html/administrator/components/com_civicrm/civicrm/CRM/Utils/Token.php on line 1471
  
  Warning: array_fill_keys() expects parameter 1 to be array, null given in /home/site/public_html/administrator/components/com_civicrm/civicrm/CRM/Utils/Token.php on line 1471
  
  Fatal error: Unsupported operand types in /home/site/public_html/administrator/components/com_civicrm/civicrm/CRM/Utils/Token.php on line 1472
  </code></pre>
  
  <p>It appears to be triggering off greetings.  I have run the job to update greetings but it appears that this is based on what it expects in the code.  Is there something that I need to change in order for the array to get what it expects?</p>
  
  <p><img src="https://i.sstatic.net/9rfBs.jpg" alt="Section of token.php this the error is referring to"></p>
  
Tags: <tokens>
Title: Error for token.php related to greeting tokens
ThreadText: # Error for token.php related to greeting tokens
  
  (Asked by: username_0 on 2015-05-04)
  
  I keep getting a error daily for one of my cron jobs:
  
  ```
  Cron <site@prefix> /usr/local/bin/php /home/site/public_html/administrator/components/com_civicrm/civicrm/bin/cli.php -s www.site.org -u adminusername -p adminpassword -e job -a execute
  
  ```
  
  The error comes in an email and looks like this:
  
  ```
  Warning: array_flip() expects parameter 1 to be array, string given in /home/site/public_html/administrator/components/com_civicrm/civicrm/CRM/Utils/Token.php on line 1470
  
  Warning: array_keys() expects parameter 1 to be array, null given in /home/site/public_html/administrator/components/com_civicrm/civicrm/CRM/Utils/Token.php on line 1471
  
  Warning: array_fill_keys() expects parameter 1 to be array, null given in /home/site/public_html/administrator/components/com_civicrm/civicrm/CRM/Utils/Token.php on line 1471
  
  Fatal error: Unsupported operand types in /home/site/public_html/administrator/components/com_civicrm/civicrm/CRM/Utils/Token.php on line 1472
  
  ```
  
  It appears to be triggering off greetings. I have run the job to update greetings but it appears that this is based on what it expects in the code. Is there something that I need to change in order for the array to get what it expects?
  
  ![Section of token.php this the error is referring to](https://i.sstatic.net/9rfBs.jpg)
  
  **Tags:** tokens
  
  
  ---
  
  ## 3 answers
  
  ### Answer by username_1 on 2015-05-04. Score: 1
  
  I'm surprised you were able to get the "Update Greetings" scheduled job to run in cron; the UI specifically disallows enabling that job. Did you turn it directly using SQL? You may want to consider whether you really want that job enabled.
  
  That aside - I'd put this line just above line 1470:
  
  ```
  print_r(CRM_Utils_Array::value($key, $greetingToken), TRUE)
  
  ```
  
  And see what you get when you run the cli command manually.
  
  > **Comments:**
  > **username_0**: I now get the error:   Parse error: syntax error, unexpected '$props' (T_VARIABLE) in /home/site/public_html/administrator/components/com_civicrm/civicrm/CRM/Utils/Token.php on line 1471  
  > **username_1**: Did you add a semi-colon to the end of the statement?  
  > **username_0**: Thanks, after I added the semi-colon I got the same error:                         Warning: array_flip() expects parameter 1 to be array, string given in /home/site/public_html/administrator/components/com_civicrm/civicrm/CRM/Utils/Token.php on line 1471  Warning: array_keys() expects parameter 1 to be array, null given in /home/site/public_html/administrator/components/com_civicrm/civicrm/CRM/Utils/Token.php on line 1472  
  > **username_0**: Warning: array_fill_keys() expects parameter 1 to be array, null given in /home/site/public_html/administrator/components/com_civicrm/civicrm/CRM/Utils/Token.php on line 1472  Fatal error: Unsupported operand types in /home/site/public_html/administrator/components/com_civicrm/civicrm/CRM/Utils/Token.php on line 1473  
  > **username_1**: Are you running the command outside of cron?  If so, I would expect that you would also receive some additional info that you weren't getting before you added that code.  
  > **username_0**: I guess I have never done that.  I guess I need to research it and take a look at what additional info I get back.  
  > **username_0**: An additional observation.  So all my cron jobs inside CiviCRM are running, however I have noticed that Scheduled Reminders is not working.  It shows that it ran but with no success.  When I run it manually, it shows "Success (1)".  So it looks like the token.php error is only affecting the automated running of the Schedule Reminder job but the job runs from inside CiviCRM manually.  Anybody have a clue how this would happen?  Getting tired of having to remember to run the scheduled reminder job everyday.  
  > **username_1**: Sorry if my last comment was ambiguous.  When I said, "run the command out of cron", I meant, "Take the command that cron is running, and run it on an interactive command line."  You should see more info than is available when the same command runs via cron.  
  
  ---
  
  ### Answer by username_2 on 2015-08-18. Score: 0
  
  this bug seems to be related to a bug regarding tokens array structure some lines above. The array is being reduced to only one of it's values. Maybe this will work:
  
  See: <https://issues.civicrm.org/jira/browse/CRM-17038>
  
  
  ---
  
  ### Answer by username_3 on 2015-12-12. Score: 0
  
  I'm also receiving the error: -
  Fatal error: Unsupported operand types in /home/accountname/public\_html/sites/all/modules/civicrm/CRM/Utils/Token.php on line 1472
  
  However, the site is running 4.6.10 so shouldn't it be resolved?
  
  > **Comments:**
  > **username_0**: If you look at username_2's comment above, the Jira ticket is closed but the fix is scheduled for 4.7 and we are still on 4.6.10.  We just have to wait until January I guess.  Until then the patch works.  
  > **username_3**: Thanks username_0, I've applied the patch and it does fix the error.  
  
  ---
  
  