Round Rock / Austin, Texas
Drupal Web Developer

Drupal Constant Contact Module Erroring Out

Drupal Constant Contact Module Erroring Out

in the module's class.cc.php file, change the beginning of function get_lists

 

    function get_lists($action = 'lists', $exclude = 3)
    {
        $xml = $this->load_url($action);

        if(!$xml):
            return false;
        endif;

        $lists = array();

        // parse into nicer array
        $_lists = (isset($xml['feed']['entry'])) ? $xml['feed']['entry'] : false;

        if(isset($xml['feed']['link']['2_attr']['rel']) && $xml['feed']['link']['2_attr']['rel'] == 'first'){
            if(!is_object($this->list_meta_data)) {
                $this->list_meta_data->first_page = $this->get_id_from_link($xml['feed']['link']['2_attr']['href']);
                $this->list_meta_data->current_page = $this->get_id_from_link($xml['feed']['link']['3_attr']['href']);
                $this->list_meta_data->next_page = '';
            }
        } elseif(isset($xml['feed']['link']['2_attr']['rel']) && $xml['feed']['link']['2_attr']['rel'] == 'next') {
            if(!is_object($this->list_meta_data)) {
                $this->list_meta_data->next_page = $this->get_id_from_link($xml['feed']['link']['2_attr']['href']);
                $this->list_meta_data->current_page = $this->get_id_from_link($xml['feed']['link']['3_attr']['href']);
                $this->list_meta_data->first_page = $this->get_id_from_link($xml['feed']['link']['4_attr']['href']);
            }
        } else {
            if(!is_object($this->list_meta_data)) {
                $this->list_meta_data->next_page = NULL;
                $this->list_meta_data->current_page = NULL;
                $this->list_meta_data->first_page = NULL;
            }
        };

        if(is_array($_lists) && count($_lists) > 3):