Welcome Guest, Not a member yet? Register   Sign In
Upgrade from CI 1.6.0 to CI 1.7.2
#2

[eluser]popovich[/eluser]
OK, maybe the code will help the situation.

From the controller:
Code:
# modules
        $pos = array('left','top','right','bottom');
        $modules = array();
        foreach ( $pos as $p ) {
            $ref_part = 'modref_'.$p;
            $parser_part = 'modules_'.$p;
            $module_content['mods'] = $this->init_modules( $this->GLO[$ref_part] );
            $this->GLO[$parser_part] = ( $module_content['mods'] ) ? $this->parser->parse('partials/modules_'.$p, $module_content) : '';
        }

    # init_models
    #
    # expects:        array
    # returns:        array
    # description:    loads and evaluates classes, the modules with the fixed orientation on the page
    #
    
    function init_modules( $modules ) {
        $retour = array();
        $this->MOD = array();
        if( count($modules) < 1 ){
            return false;
        }else{
            foreach ( $modules as $mod ) {
                $dynamic_class = 'mc_'.$mod;
                $dynamic_view = 'modules/mv_'.$mod;
                $this->load->library($dynamic_class, $mod);
                $retour[]['mod_content'] = $this->parser->parse($dynamic_view, $this->MOD[$mod]);
            }    
        }
        return $retour;
    }

The function init_modules does get the array with a variable "answers".
Here goes the custom class:

Code:
class Mc_answers {
    
     function Mc_answers( $module_name ) {
    
            $this->CI =& get_instance();
            $this->CI->load->helper('modules');
            $this->CI->MOD[$module_name] = $this->assemble( $this->CI, $module_name );
            
    }

    function assemble( $CI, $mod_label ){
    
        $retour = array();
        
        $retour['answers'] = $this->get_questions();
        $retour['headline'] = get_module_headline($CI, $mod_label, $this->CI->GLO['user_lang_id'] );
        $retour['copy'] = get_module_bodycopy($CI, $mod_label, $this->CI->GLO['user_lang_id'] );
        $retour['baseurl'] = base_url();
        
        return $retour;
    
    }

...

What is not clear, why this piece of code works fine in 1.60 but is not working in 1.72, throwing the above-quoted errors.

Cheers,
A


Messages In This Thread
Upgrade from CI 1.6.0 to CI 1.7.2 - by El Forum - 01-22-2010, 10:58 AM
Upgrade from CI 1.6.0 to CI 1.7.2 - by El Forum - 01-22-2010, 12:47 PM



Theme © iAndrew 2016 - Forum software by © MyBB