Welcome Guest, Not a member yet? Register   Sign In
Modular Extensions - HMVC version 5.2

[eluser]Sam Dark[/eluser]
Getting some errors using 5.1.19.

Code:
A PHP Error was encountered
Severity: Warning
Message: Illegal offset type in isset or empty
Filename: libraries/Controller.php
Line Number: 216

Code:
A PHP Error was encountered
Severity: Notice
Message: Undefined offset: 1
Filename: libraries/Modules.php
Line Number: 234

Also got

Code:
An Error Was Encountered
Unable to run the module: taglist//taglist

using this code

Code:
<?=modules::run('taglist')?>

[eluser]Sam Dark[/eluser]
It seems public function helper($helper) can't accept array of helpers.

[eluser]Sam Dark[/eluser]
Code:
public function helper($helper)
{
  //TODO: is this fix correct?
  if(is_array($helper)){
    foreach ($helper as $hlp){
      self::helper($hlp);  
    }
  }
  else{
    if (isset(self::$loader->_ci_helpers[$helper])) return;
    list($path, $_helper) = modules::find($helper.'_helper', $this->_module, 'helpers/');
    
    if ($path === FALSE) return self::$loader->helper($helper);  
    modules::load_file($_helper, $path);
    
    self::$loader->_ci_helpers[$_helper] = TRUE;
  }
}

[eluser]Sam Dark[/eluser]
Modules.php
Code:
($method == $controller) AND $method = 'index';
are you sure AND and not OR should be here? I thought default method is index()…

[eluser]Sam Dark[/eluser]
Modules.php
At public static function run($location):

Code:
list($module, $controller) = explode('/', $location);

if($class = self::load($module.'/'.$controller)){

What if controller is empty as in my case?

[eluser]wiredesignz[/eluser]
Hey Sam,

The first error is most likely due to attempting to load an array of helpers via $this->load->helper().

ME allows you to use the $autoload['helper'] class variable to do this more easily and only supports loading single helpers via $this->load.

The second and third errors are a bug in modules::run, which I will fix and then send an update.

EDIT:
If the controller is not specified it will fail as you suggest. The other test to determine the method is correct.

Setting index.php error_reporting(E_ALL ^E_NOTICE) will suppress these errors in the meantime.

[eluser]Sam Dark[/eluser]
Quote:and only supports loading single helpers via $this->load
In 5112 it wasn't this way… really missing it Sad

Quote:Using index.php error_reporting(E_ALL ^E_NOTICE) will suppress these in the meantime.
No, thanks Smile

Waiting for update…

[eluser]Sam Dark[/eluser]
btw. please stop using OR and END istead of IFs. It became very hard to read your code Smile

[eluser]wiredesignz[/eluser]
[quote author="Sam Dark" date="1221861426"]btw. please stop using OR and END istead of IFs. It became very hard to read your code Smile[/quote]

No thanks Sam.

[eluser]wiredesignz[/eluser]
Modular Extensions version 5.1.21 has been sent to the mailing list

Updated:
Optimized Router::locate

Re-instated:
$this->load->helper(array()) (for Sam Tongue)

Bugfix:
modules::run bug failed to find module controller when using a single segment address. thanks Sam




Theme © iAndrew 2016 - Forum software by © MyBB