• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Cannot load views after updating HMVC?

[eluser]Sven Delle[/eluser]
I've been trying to fix the callback problem with form_validation without any luck.

And in the process I downloaded the latest version of HMVC.

And now I can't load views anymore, I only get:

An Error Was Encountered
Unable to load the requested file: login_form.php

Now, what the f... is going on?

When reverting back to the previous version, everything is ok - apart from the callback form_validation problem which persists.

Anyone got any ideas?

You will get a better answer if you post this in the HMVC forum topic.

What version of CI are you running and what version of CI before that works?

[eluser]Sven Delle[/eluser]
Weird thing is they both state to be 5.4. But I can see a difference in the classes.

Line 51 in the old /third_party/MX/Controller.php says:

And the "new" (as in latest download) says:

And in the /third_party/MX/Loader.php:

There's no __construct function but an initialize function instead, and a check for MX_Controller:
if (is_a($controller, 'MX_Controller')) {
   /* reference to the module controller */
   $this->controller = $controller;
   /* references to ci loader variables */
   foreach (get_class_vars('CI_Loader') as $var => $val) {
    if ($var != '_ci_ob_level') {
     $this->$var =& CI::$APP->load->$var;
  } else {

But no matter what: it doesn't fix the form_validation callback problem, and screws up my whole app: no views load anymore!?

And by the way I never extend MX_Controller or MX_Loader anywhere in my app, but I see references to it all over the place. My modules works just fine extending CI_Controller. If I try extending MX_Controller I get all sorts of errors, so that not a direction to take.

I had the same validation callback problem.

There is a bug at HMVC with callback functions.
You have to make a workaround yourself.

The form_validation callback issue is not a bug. The solution for this has been posted many times before in other topics here. Search the forums or ACTUALLY READ the Modular Extensions - HMVC wiki. Thanks.

[eluser]Sven Delle[/eluser]
I did read the HMVC - over and over again. But my mistake was, that I managed to screw up the parameters.

I did:
$this->form_validation->set_rules('username', 'Username', 'required', 'callback_check_default_username');

Instead of:
$this->form_validation->set_rules('username', 'Username', 'required|callback_check_default_username');

I was sending four parameters to set_rules instead of piping the last couple together, making it three.

So my error had absolutely nothing to do with HMVC or call_back malfunctioning - I was simply an overtired code monkey staring at a blurred screen in the middle of the night.

I wasn't aware of that solution. Thx.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.