Details
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.