Extension, Module

Archived
Forum
(read-only)


For official support, visit the official support site »

Webservice

ExpressionEngine 2, ExpressionEngine 3, ExpressionEngine 4

Back to this add-on's main page
View Other Add-ons From Rein de Vries

     

Error After Attempting Install

Support (Resolved)

farreachjason
farreachjason

After attempting to install the Webservice add-on, we are getting the following error:

Fatal error: Call to undefined function cp_url() in /home/shw/ee_client/third_party/webservice/libraries/webservice_helper.php on line 576

Is there something else that needs to be installed?

Thanks.

Jason

 

farreachjason
# 1
farreachjason

I added the following to config.php:

// EE 2.8 cp_url function is now used to generate URLs - need to provide it if
// we are on a version prior to EE 2.8
if(!function_exists('cp_url'))
{
    
function cp_url($path$qs '')
    
{
     $path 
trim($path'/');
     
$path preg_replace('#^cp(/|$)#'''$path);
        
        
$segments explode('/'$path);
        
$result BASE.AMP.'C='.$segments[0].AMP.'M='.$segments[1];
        
     if (
is_array($qs))
     
{
      $qs 
AMP.http_build_query($qsAMP);
     
}
     
     $result 
.= $qs;
    
     return 
$result;
    
}

It seemed to fix the issue. Is this the appropriate fix?

Thanks.

Jason

Reinos
# 2
Developer
Reinos

What version of EE do you use?

And it is also better to add that in the compat.php.

Will add this to the build.

Thanks!

Best,
Rein

farreachjason
# 3
farreachjason

Rein -

Thanks. I moved this to compat.php.

We are running EE 2.7.3.

Jason