ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Modular Extensions - Version 4.3

March 03, 2008 6:10pm

Subscribe [48]
  • #646 / Jan 05, 2009 1:12pm

    simshaun

    144 posts

    As I haven’t used this library (plan on toying with it tonight)..
    Is what I posted above possible?

  • #647 / Jan 23, 2009 8:15am

    edwin87

    33 posts

    Hello CI,

    I’m having the following problem with modular extensions.

    Fatal error: Call to undefined function: _ci_load() in /***/application/libraries/Controller.php on line 407

    I’ve just followed the install instructions on WIKI. Everything works but not when a call a module inside a module.

    I made 2 modules for testing.
    - Welcome
    - Test

    I want to show the module test on the welcome page.

    This is my code:

    Controller: welcome.php

    <?php
    
    class Welcome extends Controller {
    
        function Welcome()
        {
            parent::Controller();    
        }
        
        function index()
        {
            $data['testing']  = modules::run('test');
            
            $this->load->view('welcome_message', $data);
            
        }
    }
    ?>

    Controller test

    <?php
    
    class Test extends Controller {
    
        function Test()
        {
            parent::Controller();    
        }
        
        function index()
        {
            $this->load->view('test_message');
        }
    }
    ?>

    View welcome

    
    Page rendered in {elapsed_time} seconds
    
    
    <?php echo  $testing;?>

    And the variabel test should show “This is a test”

     

    Please can somebody help me with this problem?

    In my wamp configuration it works but on my server not.

    I’m using PHP version 4.3.9 and also the HMVC php 4 version.

  • #648 / Mar 04, 2009 6:13pm

    fafworx

    4 posts

    aloha,

    got the same problem like edwin87.
    any suggestions how to improve hmvc 4.2 at ci 1.7 on a php4 server?

    my appdir looks like:

    application
      controllers
        controller.php
      views
        view.php
      modules
        test
          controllers
            controller.php
          views
            view.php

    now i want to call test modules controller (and view) from the parent view via
    modules::run(‘test/controller’);

    hmvc goes to the correct controller but the view doesnt work:
    Fatal error: Call to undefined function: _ci_load() in /application/libraries/Controller.php on line 405

    when i echo directly in the test module controller everything is fine.
    but this is not what i expect.

    please give some hints on it…

  • #649 / Mar 13, 2009 12:15pm

    edwin87

    33 posts

    Please, is there someone who can fix this problem?
    I’m having this problem for a while now and can’t fix this problem yet.

    What i’ve tried is change

    $this->load =& $this;
    to
    $this->loader =& $this;


    When i do that, it looks like it does the job but when i try to do a database query in a model in a module it breaks.

    Also when i load a library it breaks.

    This is very anoying cause i really need this great script.

  • #650 / Mar 16, 2009 8:16am

    wiredesignz

    2882 posts

    Hi edwin,

    The load issue you describe is not your problem.

    I will set up a PHP4 server to test and update version 4 to work with CI 1.7.1

    Will post back soon.

  • #651 / Mar 16, 2009 9:05am

    edwin87

    33 posts

    Thanks, that would be great!

    Keep up the good work!

  • #652 / Mar 17, 2009 5:34am

    wiredesignz

    2882 posts

    Modular Extensions 4.3 is available on the wiki

    Version 4.3 has been updated and now should work with CI 1.7.1

    Please provide feedback if you find otherwise. 😉

  • #653 / Mar 17, 2009 6:03am

    edwin87

    33 posts

    When i work with multiple databases the application breaks. It worked before. What could be the problem?

  • #654 / Mar 17, 2009 6:16am

    wiredesignz

    2882 posts

    edwin,

    Can you provide a bit more detail please. Where does the application fail, errors, line numbers etc

    It’s difficult to find bugs without relevant information.

  • #655 / Mar 17, 2009 6:24am

    edwin87

    33 posts

    That’s true!

    I’ve created a base_controller. This handles basic functions. Like choose language and that sort of stuff.

    For example:

    <?php
    class Base_controller extends Controller{
    
      var $data     =     array();    // Array om data op te slaan.
      var $aTalen     =     array();    // Array met talen
      var $wdb         =     FALSE;         // Website Database
      var $cdb         =     FALSE;         // CMS Database
    
    function Base_controller()
        {
    
            
            ob_start();
             session_start();
    
            // Controller meeladen
            parent::Controller();
            
            $this->wdb = $this->load->database("website", true);
            $this->cdb = $this->load->database("cms", true);
            
            $this->load->model('main_model');
            $this->load->model('front_page_model');
                
        } // End function
      
    }// End class
    ?>

    On every module i include my base_controller and extend it like : news extends base_controller

    So this time i don’t have to load everytime my database. 

    $WEBDB = $this->load->database('website', TRUE);
    $WEBDB->get('news');

    With the defined vars in the base controller i only needed to do this:

    $this->wdb->get('news');

    So the vars in my base_controller are broken now.

    Is there a way to fix this?

    In 4.2 it did worked.

  • #656 / Mar 17, 2009 8:17am

    edwin87

    33 posts

    I hope i made myself clear. I also found out that the function database with $parameter didn’t get a array like 4.2

    Maybe this is a problem?

  • #657 / Mar 17, 2009 11:16am

    wiredesignz

    2882 posts

    Modular Extensions 4.3.03 is available on the wiki

    Updated to fix database loading and compared functionality against CI 1.7.1 on its own.

  • #658 / Mar 17, 2009 11:54am

    edwin87

    33 posts

    Thanks for your update!

    But do you maybe have a solution for a base_controller? So that i don’t have to do things multiple?

    Like language selection like ChickenEggs in this thread?
    http://ellislab.com/forums/viewthread/73177/P520/

    It’s strange because it worked in 4.2
    So i can’t set vars anymore.


    I hope you can help me with this 😊


    Edit:

    I found out that it breaks in a model. In controllers it works. But i want to load as example :  $this->wdb->get(‘pages’); in a model function.

    But he gives a “Call to a member function on a non-object “. So he can’t find the wdb var.

  • #659 / Mar 17, 2009 10:01pm

    wiredesignz

    2882 posts

    Try moving the database connections into the models that require them rather than loading them in the controller.

  • #660 / Mar 18, 2009 5:56am

    edwin87

    33 posts

    Hello,
    Thanks, that worked 😊
    But i liked it more like i did it before. I never had to load it again. However it works now 😉


    But I found another bug.

    I’ve got a photo module.

    Here i load 3 models.

    - fotoalbum_album_model
    - fotoalbum_pics_model
    - fotoalbum_category_model

    I’ve got a function in the fotoalbum_category_model for example:

    function get_FriendlyCatTitle($id)
    {
     return url_title($id);
    }

    I try to call that function in my fotoalbum_album_model.

    Example:

    function get_Photo_Item($id)
    {
      $items = NULL;
      $items .= 'Blabla
    ';
      $items .= $this->fotoalbum_category_model->get_FriendlyCatTitle('Loll this is a friendly photo item');
    
     return $items;
    }

    Then it gives me a error like:

    Call to a member function on a non-object

    It seems that it doesn’t load the model so i tried to load the model again inside the model But then it returns that the model already is loaded.

    My debug

    DEBUG - 2009-03-18 09:32:08—> Config Class Initialized
    DEBUG - 2009-03-18 09:32:08—> Hooks Class Initialized
    DEBUG - 2009-03-18 09:32:08—> URI Class Initialized
    DEBUG - 2009-03-18 09:32:08—> Router Class Initialized
    DEBUG - 2009-03-18 09:32:08—> Output Class Initialized
    DEBUG - 2009-03-18 09:32:08—> Input Class Initialized
    DEBUG - 2009-03-18 09:32:08—> Global POST and COOKIE data sanitized
    DEBUG - 2009-03-18 09:32:08—> Language Class Initialized
    DEBUG - 2009-03-18 09:32:08—> Loader Class Initialized
    DEBUG - 2009-03-18 09:32:08—> Config file loaded: config/webqontrol_config.php
    DEBUG - 2009-03-18 09:32:08—> Helper loaded: debug_helper
    DEBUG - 2009-03-18 09:32:08—> Helper loaded: url_helper
    DEBUG - 2009-03-18 09:32:08—> Helper loaded: html_helper
    DEBUG - 2009-03-18 09:32:08—> Helper loaded: string_helper
    DEBUG - 2009-03-18 09:32:08—> Helper loaded: form_helper
    DEBUG - 2009-03-18 09:32:08—> Helper loaded: security_helper
    DEBUG - 2009-03-18 09:32:08—> Helper loaded: text_helper
    DEBUG - 2009-03-18 09:32:08—> Plugin loaded: captcha_pi
    DEBUG - 2009-03-18 09:32:08—> Language file loaded: language/dutch/webqontrol_lang.php
    DEBUG - 2009-03-18 09:32:08—> Language file loaded: language/dutch/_fotoalbum_lang.php
    ERROR - 2009-03-18 09:32:08—> Language file contains no data: language/dutch/_nieuws_lang.php
    DEBUG - 2009-03-18 09:32:08—> Language file loaded: language/dutch/_contact_lang.php
    DEBUG - 2009-03-18 09:32:08—> Language file loaded: language/dutch/_zoeken_lang.php
    DEBUG - 2009-03-18 09:32:08—> Language file loaded: language/dutch/_login_lang.php
    DEBUG - 2009-03-18 09:32:08—> Language file loaded: language/dutch/_reactie_lang.php
    DEBUG - 2009-03-18 09:32:08—> Database Driver Class Initialized
    DEBUG - 2009-03-18 09:32:08—> Database Driver Class Initialized
    DEBUG - 2009-03-18 09:32:08—> Form Validation Class Initialized
    DEBUG - 2009-03-18 09:32:08—> Email Class Initialized
    DEBUG - 2009-03-18 09:32:08—> Session Class Initialized
    DEBUG - 2009-03-18 09:32:08—> Session routines successfully run
    DEBUG - 2009-03-18 09:32:08—> Pagination Class Initialized
    DEBUG - 2009-03-18 09:32:08—> Model Class Initialized
    DEBUG - 2009-03-18 09:32:08—> Fotoalbum Controller Initialized
    DEBUG - 2009-03-18 09:32:08—> Database Driver Class Initialized
    DEBUG - 2009-03-18 09:32:08—> Database Driver Class Initialized
    DEBUG - 2009-03-18 09:32:08—> File loaded: application/models/main_model.php
    DEBUG - 2009-03-18 09:32:08—> Model Class Initialized
    DEBUG - 2009-03-18 09:32:08—> Database Driver Class Initialized
    DEBUG - 2009-03-18 09:32:08—> Database Driver Class Initialized
    DEBUG - 2009-03-18 09:32:08—> File loaded: application/models/front_page_model.php
    DEBUG - 2009-03-18 09:32:08—> Model Class Initialized
    DEBUG - 2009-03-18 09:32:08—> Database Driver Class Initialized
    DEBUG - 2009-03-18 09:32:08—> Database Driver Class Initialized
    DEBUG - 2009-03-18 09:32:08—> File loaded: application/views/frontend/zoeken/zoek_formulier_front.php
    DEBUG - 2009-03-18 09:32:08—> File loaded: application/models/frontend/nieuws/nieuws_model.php
    DEBUG - 2009-03-18 09:32:08—> Model Class Initialized
    DEBUG - 2009-03-18 09:32:08—> Database Driver Class Initialized
    DEBUG - 2009-03-18 09:32:08—> Database Driver Class Initialized
    DEBUG - 2009-03-18 09:32:08—> File loaded: application/modules/fotoalbum/models/fotoalbum_category_model.php
    DEBUG - 2009-03-18 09:32:08—> Model Class Initialized
    DEBUG - 2009-03-18 09:32:08—> Database Driver Class Initialized
    DEBUG - 2009-03-18 09:32:08—> Database Driver Class Initialized
    DEBUG - 2009-03-18 09:32:08—> File loaded: application/modules/fotoalbum/models/fotoalbum_album_model.php
    DEBUG - 2009-03-18 09:32:08—> Model Class Initialized
    DEBUG - 2009-03-18 09:32:08—> Database Driver Class Initialized
    DEBUG - 2009-03-18 09:32:08—> Database Driver Class Initialized
    DEBUG - 2009-03-18 09:32:08—> File loaded: application/modules/fotoalbum/models/fotoalbum_pics_model.php
    DEBUG - 2009-03-18 09:32:08—> Model Class Initialized

    Shows me that it is loaded. So what could be the problem here?

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases