Jump to content

[SOLVED] initProcess not called and currentIndex not set for a custom admin module


cram1010
 Share

Recommended Posts

I'm creating a very simple custom admin module, which introduces a "Family" taxonomy quite similar to the core "Supplier" functionality.

 

Things worked fine, except that the "Add New" button in the toolbar didn't work. When it was clicked, it redirected to the dashboard.

 

I found out that the href of the "Add New" button was:

&addfamily&token=some_token

instead of

/index.php?controller=AdminFamilies&addfamily&token=some_token.

To correct it, I had to add in my AdminFamiliesController constructor:

self::$currentIndex = 'index.php?controller=AdminFamilies';

Not very nice, but then the href was the correct.

 

But it wasn't all. Now that the href vas the correct, clicking in the "Add New" button didn't redirect to the dashboard, but to the list again.

 

I digged a little more and found out that "AdminController->initProcess()" wasn't being called. This is essential because it is the responsible to redirect to one action or another in function of the GET parameters.

 

I added:

$this->initProcess();

and now it works.

 

But my question is if all of this is required. That two things should work out of the box. $currentIndex should be set, and initProcess() should be called.

 

Am I missing something or it is supposed to work that way?

 

 

Edited by cram1010 (see edit history)
  • Like 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More