Jump to content


Photo

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


  • Please log in to reply
1 reply to this topic

#1 wirespring

wirespring

    Member

  • Members
  • PipPip
  • 29 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:

 

https://dynamic.wire...tacts/list/id/2

 

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

 

https://dynamic.wire...x.php/list/id/2

 

which gives a 404 error.

 

The links on the All Contacts List are fine.



#2 jack

jack

    Admin

  • Administrators
  • 44 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();

 

after 

 

        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(
            '<span>'.X2Html::encode($x2list->name).'</span>',
            $url,
            array()
        );
 
    }





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users