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]
  • #586 / Jul 23, 2008 10:08am

    Stylec

    14 posts

    I’ve got 3 admin.php files.
    1 in each module, admin, member & news.
    I’ve just changed the news admin.php file to admina.php to make it unique and updated the modules::run code but still get the same error
    Unable to run the requested module: news/controllers/admina->adminpanelblock.

  • #587 / Jul 23, 2008 10:37am

    wiredesignz

    2882 posts

    @Stylec, Can you post a debug log file please?

  • #588 / Jul 23, 2008 10:54am

    Stylec

    14 posts

    How do I do that 😊

    EDIT:
    Is this it?

    DEBUG - 2008-07-23 15:00:57 --> Config Class Initialized
    DEBUG - 2008-07-23 15:00:57 --> Hooks Class Initialized
    DEBUG - 2008-07-23 15:00:57 --> URI Class Initialized
    DEBUG - 2008-07-23 15:00:57 --> Router Class Initialized
    DEBUG - 2008-07-23 15:00:57 --> Output Class Initialized
    DEBUG - 2008-07-23 15:00:57 --> Input Class Initialized
    DEBUG - 2008-07-23 15:00:57 --> Global POST and COOKIE data sanitized
    DEBUG - 2008-07-23 15:00:57 --> Language Class Initialized
    DEBUG - 2008-07-23 15:00:57 --> Loader Class Initialized
    DEBUG - 2008-07-23 15:00:57 --> Admin Controller Initialized
    DEBUG - 2008-07-23 15:00:57 --> Helpers loaded: url
    DEBUG - 2008-07-23 15:00:57 --> Database Driver Class Initialized
    DEBUG - 2008-07-23 15:00:57 --> Session Class Initialized
    DEBUG - 2008-07-23 15:00:57 --> File loaded: application/config/autoload.php
    DEBUG - 2008-07-23 15:00:57 --> File loaded: application/modules/admin/models/admin_model.php
    DEBUG - 2008-07-23 15:00:57 --> Model Class Initialized
  • #589 / Jul 23, 2008 11:23am

    wiredesignz

    2882 posts

    Is there any more to it? Set log threshold = 4

    I dont see the views loaded or any modules.

  • #590 / Jul 23, 2008 11:27am

    Stylec

    14 posts

    With

    $config['log_threshold'] = 4;

    thats all I get.

  • #591 / Jul 23, 2008 12:48pm

    wiredesignz

    2882 posts

    Well I see very little happening in your logs. The admin_model loads and it stops?

    Example log:

    DEBUG - 2008-07-17 17:06:20 --> Config Class Initialized
    DEBUG - 2008-07-17 17:06:20 --> Hooks Class Initialized
    DEBUG - 2008-07-17 17:06:20 --> URI Class Initialized
    DEBUG - 2008-07-17 17:06:20 --> No URI present. Default controller set.
    DEBUG - 2008-07-17 17:06:20 --> Router Class Initialized
    DEBUG - 2008-07-17 17:06:20 --> Output Class Initialized
    DEBUG - 2008-07-17 17:06:20 --> Input Class Initialized
    DEBUG - 2008-07-17 17:06:20 --> Global POST and COOKIE data sanitized
    DEBUG - 2008-07-17 17:06:20 --> Language Class Initialized
    DEBUG - 2008-07-17 17:06:20 --> CMS Controller Initialized
    DEBUG - 2008-07-17 17:06:20 --> Loader Class Initialized
    DEBUG - 2008-07-17 17:06:20 --> Helpers loaded: array, debug, flash, il8n
    DEBUG - 2008-07-17 17:06:20 --> Database Driver Class Initialized
    DEBUG - 2008-07-17 17:06:20 --> File loaded: application/modules/template/controllers/template.php
    DEBUG - 2008-07-17 17:06:20 --> Template Controller Initialized
    DEBUG - 2008-07-17 17:06:20 --> Helpers loaded: url_helper
    DEBUG - 2008-07-17 17:06:20 --> Helpers loaded: form_helper
    DEBUG - 2008-07-17 17:06:20 --> File loaded: application/modules/template/helpers/asset_helper.php
    DEBUG - 2008-07-17 17:06:20 --> File loaded: application/modules/settings/controllers/settings.php
    DEBUG - 2008-07-17 17:06:20 --> Settings Controller Initialized
    DEBUG - 2008-07-17 17:06:20 --> File loaded: application/modules/settings/models/settings_model.php
    DEBUG - 2008-07-17 17:06:20 --> Settings_model Model initialised
    DEBUG - 2008-07-17 17:06:20 --> File loaded: application/modules/nav/controllers/nav.php
    DEBUG - 2008-07-17 17:06:20 --> Nav Controller Initialized
    DEBUG - 2008-07-17 17:06:20 --> File loaded: application/modules/nav/models/nav_model.php
    DEBUG - 2008-07-17 17:06:20 --> Nav_model Model initialised
    DEBUG - 2008-07-17 17:06:20 --> File loaded: application/modules/content/controllers/content.php
    DEBUG - 2008-07-17 17:06:20 --> Content Controller Initialized
    DEBUG - 2008-07-17 17:06:20 --> File loaded: application/modules/content/models/page_model.php
    DEBUG - 2008-07-17 17:06:20 --> Page_model Model initialised
    DEBUG - 2008-07-17 17:06:20 --> File loaded: application/views/default/page_header.htm
    DEBUG - 2008-07-17 17:06:20 --> File loaded: application/views/default/nav.htm
    DEBUG - 2008-07-17 17:06:20 --> File loaded: application/views/default/nav.htm
    DEBUG - 2008-07-17 17:06:20 --> File loaded: application/views/default/nav.htm
    DEBUG - 2008-07-17 17:06:20 --> File loaded: application/views/default/nav.htm
    DEBUG - 2008-07-17 17:06:20 --> File loaded: application/views/default/nav.htm
    DEBUG - 2008-07-17 17:06:20 --> File loaded: application/views/default/head_image.htm
    DEBUG - 2008-07-17 17:06:20 --> File loaded: application/views/default/content.htm
    DEBUG - 2008-07-17 17:06:20 --> File loaded: application/views/default/content.htm
    DEBUG - 2008-07-17 17:06:20 --> File loaded: application/views/default/sidebar.htm
    DEBUG - 2008-07-17 17:06:20 --> File loaded: application/views/default/default.htm
    DEBUG - 2008-07-17 17:06:20 --> Final output sent to browser
    DEBUG - 2008-07-17 17:06:20 --> Total execution time: 0.2936
  • #592 / Jul 23, 2008 1:53pm

    Stylec

    14 posts

    Ok ive done a clean install of CI 1.6.3 + ME 4206. Moved the welcome controller and welcome view into a module. Created an admin module with just 1 controller (admin.php) and 1 method called ‘test’. The admin method ‘test’ just echos a string.

    In the welcome_message.php view file ive just got

    echo modules::run('admin', '', 'test');

    This works as expected and produces the following log

    DEBUG - 2008-07-23 17:50:44 --> Config Class Initialized
    DEBUG - 2008-07-23 17:50:44 --> Hooks Class Initialized
    DEBUG - 2008-07-23 17:50:44 --> URI Class Initialized
    DEBUG - 2008-07-23 17:50:44 --> No URI present. Default controller set.
    DEBUG - 2008-07-23 17:50:44 --> Router Class Initialized
    DEBUG - 2008-07-23 17:50:44 --> Output Class Initialized
    DEBUG - 2008-07-23 17:50:44 --> Input Class Initialized
    DEBUG - 2008-07-23 17:50:44 --> Global POST and COOKIE data sanitized
    DEBUG - 2008-07-23 17:50:44 --> Language Class Initialized
    DEBUG - 2008-07-23 17:50:44 --> Welcome Controller Initialized
    DEBUG - 2008-07-23 17:50:44 --> Loader Class Initialized
    DEBUG - 2008-07-23 17:50:44 --> File loaded: C:\xampplite\htdocs\me_test/system/application/modules/admin/controllers/admin.php
    DEBUG - 2008-07-23 17:50:44 --> Admin Controller Initialized
    DEBUG - 2008-07-23 17:50:44 --> File loaded: C:\xampplite\htdocs\me_test/system/application/modules/welcome/views/welcome_message.php
    DEBUG - 2008-07-23 17:50:44 --> Final output sent to browser
    DEBUG - 2008-07-23 17:50:44 --> Total execution time: 0.0949

    But when I change it to

    echo modules::run('admin/controllers/admin', '', 'test');

    which I would have thought would have been the same thing as above, I just get a blank page and the following log.

    DEBUG - 2008-07-23 17:52:11 --> Config Class Initialized
    DEBUG - 2008-07-23 17:52:11 --> Hooks Class Initialized
    DEBUG - 2008-07-23 17:52:11 --> URI Class Initialized
    DEBUG - 2008-07-23 17:52:11 --> No URI present. Default controller set.
    DEBUG - 2008-07-23 17:52:11 --> Router Class Initialized
    DEBUG - 2008-07-23 17:52:11 --> Output Class Initialized
    DEBUG - 2008-07-23 17:52:11 --> Input Class Initialized
    DEBUG - 2008-07-23 17:52:11 --> Global POST and COOKIE data sanitized
    DEBUG - 2008-07-23 17:52:11 --> Language Class Initialized
    DEBUG - 2008-07-23 17:52:11 --> Welcome Controller Initialized
    DEBUG - 2008-07-23 17:52:11 --> Loader Class Initialized
    DEBUG - 2008-07-23 17:52:11 --> File loaded: C:\xampplite\htdocs\me_test/system/application/modules/welcome/views/welcome_message.php
    DEBUG - 2008-07-23 17:52:11 --> Final output sent to browser
    DEBUG - 2008-07-23 17:52:11 --> Total execution time: 0.0826

    Maybe its not possible to call a method from a controller which isn’t named the same as the module folder?

  • #593 / Jul 23, 2008 2:56pm

    a&w

    101 posts

    You might try:

    echo modules::run('admin/admin', '', 'test');

    I don’t think you need to put controllers in there.

  • #594 / Jul 23, 2008 3:09pm

    Stylec

    14 posts

    OK, that works in my clean install of CI + ME, and from that ive found that its because of the search paths as suggested by wiredesignz.
    So how can I get around the problem of having an admin.php controller in each module?
    I would have thought that as I specify the module the method is in, it wouldn’t have been a problem.

  • #595 / Jul 28, 2008 3:29pm

    Chicken's Egg

    39 posts

    I had some unexpected behaviour of ME today.

    A have split the application folder into two separate folders: back-end en front-end. http://www.mysite.com/admin/ brings me to the back-end of the application. Normally the frond-end is used.

    Situation:
    - DIR: admin
      - FILE: index.php
    - DIR: frontend
      - DIR: controllers
      - FILE: base_controller.php
      - (..)
      - DIR: modules
      - DIR: home
        - DIR: controllers
          - FILE: home.php- DIR: backend
      - DIR: controllers
      - FILE: base_controller.php
      - (..)
      - DIR: modules etc.
      - DIR: home
        - DIR: controllers
          - FILE: home.php
    - DIR: media
    - FILE: index.php

    My default controller is home.php

    Situation now:
    http://www.mysite.com/admin/      Shows backend home.php
    http://www.mysite.com/admin/home/  Shows frontend home.php

    The last is wrong and should have shown up the backend aswell. The base_controller is called like
    include_once(APPPATH . ‘controllers/base_controller.php’) but doesn’t have a function yet. I’m a little bit confused.

  • #596 / Jul 28, 2008 5:53pm

    wiredesignz

    2882 posts

    Why would you assume ME is doing this and not something else you have altered, or forgotten to alter correctly?

  • #597 / Jul 29, 2008 2:05am

    Chicken's Egg

    39 posts

    Well, I can’t exclude that possibility, thought I wonder what it would have been.

    Base_controller.php

    <?php
    class Base_controller extends Controller{
    
      protected $data = array();   // Array om data op te slaan.
    
      function __construct()
      {
        // Error reporting:
        ini_set('display_errors', 1);
        error_reporting(E_ALL);
    
        // Controller meeladen
        parent::Controller();
      }
    
      public function main_view()
      {
        // Template laden:
        $this->load->view($this->view_dir . 'main',$this->data);
      }
    }
    ?>

    home.php

    <?php
    // Base Controller activeren
    include_once(APPPATH . 'controllers/base_controller.php');
    
    class Home extends Base_controller {
    
        function __construct()
        {
          // Parent class meeladen
          // Uitvoeren:
          // - Hoofdmenu inbouwen
          // - Standaard teksten vastleggen.
          parent::__construct();
        }
        
        function index()
        {
          // Load view
          // parent::main_view();
          echo 'Backend test 1';
        }
    }

    I don’t see any problem with these controllers. The controllers in the frontend look equal, but of course an other text is showed.

    Alternations:
    The follow is changed (according to the wiki) in order to get two applications:
    1) Create a new directory called ‘admin/’.
    2) Copy the index.php file in ‘admin/’
    3) Copy the application folder and call it ‘
    4) Open admin/index.php. Alter:
      - Line 44: $application_folder = “../backend”;

    I wonder why I don’t get the result I expect. There are no error-messages and I don’t see anything special in the debug. I’ve also tested the possibility to place home.php into the default backend-controllers directory; same result. As for your question: no I don’t know whether this is a CI or a ME problem. As http://www.mysite.com/admin/ worked fine I thought it might be a ME problem.

  • #598 / Jul 29, 2008 4:05am

    wiredesignz

    2882 posts

    I don’t see any problem with these controllers.

    So where are the class variables for $this->view_dir and $this->data as shown above?

    Why not remove the Modular Extensions libraries and see if your controllers load properly without it first.

  • #599 / Jul 29, 2008 5:51am

    Chicken's Egg

    39 posts

    I solved the problem by adding a .htaccess file in the admin-directory. I hope this will do the trick.

    Why not remove the Modular Extensions libraries and see if your controllers load properly without it first.

    I had done that, without any result.

  • #600 / Jul 29, 2008 6:50am

    wiredesignz

    2882 posts

    I had done that, without any result.

    So the problem was not with Modular Extensions.

    Good luck with your application.

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

ExpressionEngine News!

#eecms, #events, #releases