Answers.Body: <p>I found this on the github issue list: <a href="https://github.com/cividesk/com.cividesk.email.sparkpost/pull/58/commits/69a0bdb17bb520334da7f472a2d7670b44da8071" rel="nofollow noreferrer">https://github.com/cividesk/com.cividesk.email.sparkpost/pull/58/commits/69a0bdb17bb520334da7f472a2d7670b44da8071</a></p>
  
  <p>Applied the commit and it has resolved the problem.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-06-18T15:03:09.053Z
Answers.LastActivityDate: 2018-06-18T15:03:09.053Z
Answers.UserDisplayName: Darren
Body: <p>Drupal 7.59 Civi 5.1.2 PHP 7 MariaDB 10.1 Debian 9</p>
  
  <p>If our users access "example.com/civicrm" without first logging into Drupal, they receive a generic white page with the message "Error
  The website encountered an unexpected error. Please try again later.", but also with a green drupal message saying "Log in successful for ...."</p>
  
  <p>Upon refreshing the page, users can then access Civi normally.</p>
  
  <p>Just one php error in the recent log messages:-</p>
  
  <blockquote>
    <p>Error: Call to undefined function civicrmVersion() in
    sparkpost_civicrm_check() (line 145 of
    /var/www/sites/default/files/civicrm/extensions/com.cividesk.email.sparkpost/sparkpost.php).</p>
  </blockquote>
  
  <p>Could anyone advise the fix for this? Thanks!</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-06-18T14:45:07.390Z
Comments.Text: Sparkpost version is 1.1
Comments.UserDisplayName: Darren
Tags: <sparkpost><5.1.0>
Title: What is the cause of Error: Call to undefined function civicrmVersion() in sparkpost_civicrm_check()
ThreadText: # What is the cause of Error: Call to undefined function civicrmVersion() in sparkpost_civicrm_check()
  
  (Asked by: username_0 on 2018-06-18)
  
  Drupal 7.59 Civi 5.1.2 PHP 7 MariaDB 10.1 Debian 9
  
  If our users access "example.com/civicrm" without first logging into Drupal, they receive a generic white page with the message "Error
  The website encountered an unexpected error. Please try again later.", but also with a green drupal message saying "Log in successful for ...."
  
  Upon refreshing the page, users can then access Civi normally.
  
  Just one php error in the recent log messages:-
  
  > Error: Call to undefined function civicrmVersion() in
  > sparkpost\_civicrm\_check() (line 145 of
  > /var/www/sites/default/files/civicrm/extensions/com.cividesk.email.sparkpost/sparkpost.php).
  
  Could anyone advise the fix for this? Thanks!
  
  **Tags:** sparkpost, 5.1.0
  
  > **Comments:**
  > **username_0**: Sparkpost version is 1.1  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2018-06-18. Score: 3 | Accepted answer
  
  I found this on the github issue list: <https://github.com/cividesk/com.cividesk.email.sparkpost/pull/58/commits/69a0bdb17bb520334da7f472a2d7670b44da8071>
  
  Applied the commit and it has resolved the problem.
  
  
  ---
  
  