I'm working on simple CRUD (create, read, update and delete) module without grid or ui component, just simple CRUD.
So when i'm trying to create add/edit form, i've meet some weird issue, when i click on add/edit button, it redirect to my admin dashboard (At first i think it was acl.xml problem, but it wasn't).
The controller for edit/add is almost excactly like the list/manage controller. enter image description here

I've try to find the problem many hours but no chance.
Here is my module, please take a look.

1 Answer 1


You get URL without formkey.

Add to your


public function getAddUrl()
        return $this->getUrl('department/manage/add');

and change in


$addlUrl = $adminUrl . '/department/manage/add';


$addlUrl = $block->getAddUrl();
  • thanks, i will try as soon as i can and feedback to you, thanks for answer my question.
    – fudu
    Aug 28, 2019 at 8:40
  • its worked, thanks.
    – fudu
    Aug 29, 2019 at 3:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.