Jump to content


[BUG] - Wrong URL in link to contact list from campaigns

  • Please log in to reply
1 reply to this topic

#1 wirespring


    Advanced Member

  • Members
  • PipPipPip
  • 31 posts

Posted 23 June 2020 - 08:32 AM

(8.0, open source edition)


The link to the Contact List that appears on both the "All Campaigns" page (/index.php/marketing) and inside of a Campaign itself (e.g. /index.php/marketing/2) is incorrect. In my case my Campaign #2 is supposed to use Contact List #2, and the URL should be:




however on both of the above pages the link generated is:




which gives a 404 error.


The links on the All Contacts List are fine.

#2 jack



  • Administrators
  • 61 posts

Posted 24 June 2020 - 08:13 AM

Hi wirespring, I have written a fix for this and it will be in the next update. 
If you need it now you'll need to edit protected/components/formatters/FieldFormatter.php

In the function renderAttribute add the line


if($field->fieldName == "listId")return $this->renderListLink();




        if (!isset($field))
            return null;
And add this function to the file

     * renders the fields for list links
    protected function renderListLink (){
        $url = null;
        // Use the controller
        $x2list = X2list::model()->findByAttributes(array('nameId' => $this->owner->listId));
        if(!isset($x2list)) return;
        $modelName = "contacts";
        if(!empty($x2list->modelName)) $modelName = strtolower($x2list->modelName);
        if($modelName == "x2leads")$modelName = "x2Leads";
        if(!ResponseUtil::isCli() && Yii::app()->controller instanceof CController && !Yii::app()->controller instanceof ProfileController) {
            $url = Yii::app()->controller->createAbsoluteUrl($modelName."/list", array('id' => $this->owner->id));
        if(empty($url)) { // Construct an absolute URL; no web request data available.
            $url = Yii::app()->absoluteBaseUrl.(YII_UNIT_TESTING?'/index-test.php':'/index.php').$modelName."/list".'/'.$this->owner->id;
        return CHtml::link(

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users