Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-18313

Contribution tracker widget not working for Drupal sites

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Trivial
    • Resolution: Duplicate
    • Affects Version/s: 4.7.3, 4.7.4
    • Fix Version/s: None
    • Component/s: CiviContribute
    • Labels:
    • Documentation Required?:
      None
    • Funding Source:
      Core Team Funds

      Description

      When I use the Contribution Page widget feature, it wouldn't work. This is what I got in my logs:

      Fatal error: Call to undefined function drupal_add_http_header() in sites/all/modules/civicrm/CRM/Utils/System/Drupal.php on line 789" while reading response header from upstream, client: 66.66.230.42, server: members.rochesterkinksociety.com, request: "GET /sites/all/modules/civicrm//extern/widget.php?cpageId=1&widgetId=1&format=3&_=1459203268797 HTTP/1.1"

      For some reason it calls the function setHttpHeader in CRM/Utils/System/Drupal.php while Drupal isn't loaded nor necessary for this widget to work. It works when I comment out the offending code.

      The more correct way of solving this would be to do the following code but I'm not sure whether there is an internal 'CRM' way of adding generic headers.

      {{public function setHttpHeader($name, $value) {
      if (function_exists("drupal_add_http_header"))

      { drupal_add_http_header($name, $value); }

      else

      { //Drupal isn't loaded header($name . ": " $value); }

      }
      }}

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              guruevi Evi Vanoost
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: