Details
-
Type: Bug
-
Status: Done/Fixed
-
Priority: Major
-
Resolution: Fixed/Completed
-
Affects Version/s: 4.3.0, 4.3.1, 4.3.2, 4.3.3, 4.3.4
-
Fix Version/s: 4.3.5
-
Component/s: WordPress Integration
-
Labels:
Description
During SOAP authentication against Wordpress 3.5.1+ and CCRM 4.3+ you get the following error:
Call to undefined function wp_authenticate()
This error is thrown in CRM_Utils_System_WordPress::authenticate (line 367 in CCRM 4.3.4, line 364 in CCRM 4.3.0)
$user = wp_authenticate($name, $password);
Here's a proposed fix (line #s are for CCRM 4.3.0):
1. edit <your_wp_location>/wp-content/plugins/civicrm/civicrm/CRM/Utils/SoapServer.php to load bootstrap when in WordPress environment:
128c128
< if ($this->ufClass == 'CRM_Utils_System_Joomla' || $this->ufClass == 'CRM_Utils_System_WordPress'){
—
> if ($this->ufClass == 'CRM_Utils_System_Joomla'){
2. edit <your_wp_location>/wp-content/plugins/civicrm/civicrm/CRM/Utils/System/WordPress.php
to load the bootstrap using an instance of CRM_Utils_System_WordPress class rather than calling it as a static method ( calling it as a static method results in errors when called from SOAP layer due to some changes that happened in CRM_Utils_System_WordPress::loadBootStrap and CRM_Utils_System_WordPress::cmsRootPath functions, in particular the fact that they now contain calls using a $this instance rather than static calls to self:: as before and when called from the SOAP layer $this means SoapServer instance which results in errors):
361c361
< self::loadBootstrap($name, $password);
—
> $config->userSystem->loadBootstrap($name, $password);