Welcome Guest, Not a member yet? Register   Sign In
CI 2.1.3 - ci_modular issue?
#1

[eluser]gabybob[/eluser]
HI,

Ouppsss a small anomaly crept at ci_modular it crashes the program loader view.

another PB with the inclusion of models, although the patch

I am inspired by the amendment proposed by Veneziano carlo
4548548 - Fix error rised in CI => 2.0.3 Fatal error: Call to undefined method MY_Lo...
https://bitbucket.org/wanwizard/modular-ci

Code:
corrective module manager ci_modular whith CI=>2.13
application/core/MY_loader.php  and  /libraries/module.php
access  protected  to  _ci_load()  and  _ci_object_to_array($object)
writting one method into MY_loader.php  get_load_view(.........)
/**
  * Expose protected property this->load->_ci_load()
  * needed in by Module_view::__construct()
  * in application/libraries/Module.php
  *
  * @return array
  */
function get_load_view($view, $vars = array(), $return = FALSE, $path) {
  
  if ( $return )
  {
   return $this->_ci_load(array('_ci_path' => $path.'views/'.$view.EXT, '_ci_vars' => $this->_ci_object_to_array($vars), '_ci_return' => $return));
  }
  else
  {
   $this->_ci_load(array('_ci_path' => $path.'views/'.$view.EXT, '_ci_vars' => $this->_ci_object_to_array($vars), '_ci_return' => $return));
  }
}


into /libraries/module.php

function view($view, $vars = array(), $return = FALSE)
{
  // get the CI superobject
  $CI =& get_instance();

  $CI->load->get_load_view($view, $vars, $return, $this->_path);

}

Another problem with the loading of a class of type module-> model
line 650 to 669 libraries/Module.php
Code:
// loves me some nesting!
  foreach (array(strtolower($class), strtolower($class)) as $name)
  {
   $filepath = $this->_path.'models/'.$name.EXT;

   if (file_exists($filepath))
   {
    include_once $filepath;
    break;
   }
  }
  /* @gabriel_byoos build one class name from class_model name 2012/10/30  21:11  */
  // the module file can't be found
  $model_class=explode('_', ucfirst($class));
  $class = ucfirst($model_class[0]);
  if ( ! class_exists($class))
  {
   log_message('error', "Unable to load the requested module model: ".$class);
   show_error("Unable to load the requested module model: ".$class);
  }

can not find the name of the class to disk because ucfirst function ($ class) forces a filename Department.php type and class name as Department.

seen code ci_modular V1.0 class will never be charged.

PB also with other libraries loader ... ??? to follow

it's correct ?

gabriel




Theme © iAndrew 2016 - Forum software by © MyBB