Body: <p>I get an error with tracked urls in mailings. When the user clicks the link inside the mail, he gets a page telling him "error 500".</p>
  
  <p>If error reporting is on in php, I get following error:</p>
  
  <pre><code>Fatal error: Call to undefined function drupal_add_http_header() in /home/www/&lt;...&gt;/sites/all/modules/civicrm/CRM/Utils/System/Drupal.php on line 790
  </code></pre>
  
  <p>The URL called is</p>
  
  <pre><code>http://&lt;mydomain&gt;/sites/all/modules/civicrm/extern/url.php?u=221&amp;qid=1851
  </code></pre>
  
  <p>As workaround, I could solve the problem adding a call to loadBootStrap():</p>
  
  <pre><code>  public function setHttpHeader($name, $value) {
      self::loadBootStrap([], false);
      drupal_add_http_header($name, $value);
    }
  </code></pre>
  
  <p>But I belive this a very dirty thing to do! :-/</p>
  
  <p>With this fix, all things works fine with the same url from above!</p>
  
  <p>I'm using CiviCRM 4.7.Beta3 and Drupal core 7.41.</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-12-20T06:32:16.213Z
Comments.Text: What version of CiviCRM are you using?
Comments.UserDisplayName: Allen Hutchison
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-12-20T06:36:57.823Z
Comments.Text: When the user clicks on the link, what does the resulting web address look like? Might anything from this question help - http://civicrm.stackexchange.com/q/3569/105 ?
Comments.UserDisplayName: Allen Hutchison
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-12-20T16:05:35.913Z
Comments.Text: I'm using CiviCRM 4.7.Beta3 and Drupal core 7.41.
  
  
  URLs are just right, but like mentioned in the post, I get this "undefinend function error"!
  
  
  The error from your link something different.
Comments.UserDisplayName: Tiggr
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-12-20T18:54:21.947Z
Comments.Text: Please update your question to provide an example URL in reply to Allen's question above?
Comments.UserDisplayName: Chris Burgess
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-12-20T19:29:31.137Z
Comments.Text: If edited the question!
Comments.UserDisplayName: Tiggr
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-12-22T19:23:50.033Z
Comments.Text: Thank you @Tiggr for the additional info.  Did you install 4.7beta3 fresh or was it an upgrade from a prior version? If an upgrade, what version did you upgrade from?
Comments.UserDisplayName: Allen Hutchison
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-12-23T00:00:03.523Z
Comments.Text: My 4.7beta3 is an upgrade from 4.6.10
Comments.UserDisplayName: Tiggr
Tags: <civimail><drupal><bootstrap><tracked-links>
Title: Mailings: Error 500 with Click Through Tracking
ThreadText: # Mailings: Error 500 with Click Through Tracking
  
  (Asked by: username_0 on 2015-12-18)
  
  I get an error with tracked urls in mailings. When the user clicks the link inside the mail, he gets a page telling him "error 500".
  
  If error reporting is on in php, I get following error:
  
  ```
  Fatal error: Call to undefined function drupal_add_http_header() in /home/www/<...>/sites/all/modules/civicrm/CRM/Utils/System/Drupal.php on line 790
  
  ```
  
  The URL called is
  
  ```
  http://<mydomain>/sites/all/modules/civicrm/extern/url.php?u=221&qid=1851
  
  ```
  
  As workaround, I could solve the problem adding a call to loadBootStrap():
  
  ```
    public function setHttpHeader($name, $value) {
      self::loadBootStrap([], false);
      drupal_add_http_header($name, $value);
    }
  
  ```
  
  But I belive this a very dirty thing to do! :-/
  
  With this fix, all things works fine with the same url from above!
  
  I'm using CiviCRM 4.7.Beta3 and Drupal core 7.41.
  
  **Tags:** civimail, drupal, bootstrap, tracked-links
  
  > **Comments:**
  > **username_1**: What version of CiviCRM are you using?  
  > **username_1**: When the user clicks on the link, what does the resulting web address look like? Might anything from this question help - http://civicrm.stackexchange.com/q/3569/105 ?  
  > **username_0**: I'm using CiviCRM 4.7.Beta3 and Drupal core 7.41.   URLs are just right, but like mentioned in the post, I get this "undefinend function error"!   The error from your link something different.  
  > **username_2**: Please update your question to provide an example URL in reply to username_1's question above?  
  > **username_0**: If edited the question!  
  > **username_1**: Thank you @username_0 for the additional info.  Did you install 4.7beta3 fresh or was it an upgrade from a prior version? If an upgrade, what version did you upgrade from?  
  > **username_0**: My 4.7beta3 is an upgrade from 4.6.10  
  
  ---
  
  ## 0 answers
  
  