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

SOAP calls in Drupal result in "Call to undefined method CRM_Utils_SoapServer::getUsersTableName()" error

    Details

    • Documentation Required?:
      None
    • Funding Source:
      Core Team Funds

      Description

      SOAP calls for processing bounces in Drupal result in "Call to undefined method CRM_Utils_SoapServer::getUsersTableName()" error.

      This is occurring due to the following call in CRM/Utils/SoapServer.php on line 125:

      $result =& $className::authenticate($name, $pass, $loadCMSBootstrap);
      

      Which statically calls non-static method "authenticate" on the CRM_Utils_System_Drupal class and where the following code has been added

      $userFrameworkUsersTableName = $this->getUsersTableName();
      

      In this context "$this" becomes an instance of CRM_Utils_SoapServer rather than an instance of CRM_Utils_System_Drupal

      Here are the relevant code changes:

      1. method "authenticate" made non-static:

      https://github.com/civicrm/civicrm-core/commit/17f443df7d2235655cbbfe68bfcf7a13a570b606

      2. "$this->getUsersTableName();" line added:

      https://github.com/civicrm/civicrm-core/commit/348754d5baf83293564406b5770f01edf647b74b

      Proposed fix is to remove the deprecated static call in SoapServer.php and instantiate the Drupal class before calling the "authenticate" method on it:

      Replace line 125:

      $result =& $className::authenticate($name, $pass, $loadCMSBootstrap);
      

      with

      $ufInstance = new $this->ufClass();
      $result =& $ufInstance->authenticate($name, $pass, $loadCMSBootstrap);
      

      All of the other CRM_Utils_System_* cms specific files have the non-static authenticate method so this should work for all though we only tested that this patch works with Drupal.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              alleyla Leyla Alieva
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: