Magento 2 - Backend custom module 404 error












5














I'm trying to create my custom module in the back-end, I followed a lot of tutorials, but I continue to get 404 error when I try to access to my controller. The only thing that work fine is the menu option, but when I go to http:/admin_host/macrocategorie/config/ I get Page not found 404



I have already tried to run this command:




  • php bin/magento setup:upgrade

  • php bin/magento setup:di:compile

  • php bin/magento cache:clean

  • php bin/magento cache:flush


But nothing change.



I have used below code :



VendorModuleregistration.php



<?php      MagentoFrameworkComponentComponentRegistrar::register(
MagentoFrameworkComponentComponentRegistrar::MODULE,
'Vendor_Module',
__DIR__ );


VendorModuleetcmodule.xml



<?xml version="1.0"?><config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd">
<module name="Vendor_Module" setup_version="2.0.0"/></config>


VendorModuleetcadminhtmlroutes.xml



<?xml version="1.0"?><config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd">
<router id="admin">
<route id="macrocategorie" frontName="macrocategorie">
<module name="Vendor_Module" before="Magento_Backend"/>
</route>
</router></config>


VendorModuleetcadminhtmlmenu.xml



<?xml version="1.0"?><config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Magento/Backend/etc/menu.xsd">
<menu>
<add
id="Vendor_Module::macrocategorie"
title="Macrocategorie"
module="Vendor_Module"
sortOrder="100"
parent="Magento_Backend::stores"
resource="Vendor_Module::macrocategorie"
/>
<add
id="Vendor_Module::config"
title="Configura Macrocategorie"
module="Vendor_Module"
sortOrder="105"
parent="Vendor_Module::macrocategorie"
action="macrocategorie/config/"
resource="Vendor_Module::index"
/>
</menu></config>


VendorModuleControllerAdminhtmlConfigIndex.php



<?php namespace VendorModuleControllerAdminhtmlConfig; use MagentoBackendAppActionContext; use MagentoFrameworkAppResponseInterface; use MagentoFrameworkViewResultPageFactory; class Index extends MagentoBackendAppAction {

protected $resultPageFactory;

public function __construct(
Context $context,
PageFactory $resultPageFactory
)
{
parent::__construct($context);
$this->resultPageFactory = $resultPageFactory;
}

/**
* Dispatch request
*
* @return MagentoFrameworkControllerResultInterface|ResponseInterface
* @throws MagentoFrameworkExceptionNotFoundException
*/
public function execute()
{
die("Controller backend");
$resultPage = $this->resultPageFactory->create();

return $resultPage;
} }


Thank's for the support










share|improve this question
















bumped to the homepage by Community yesterday


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.




















    5














    I'm trying to create my custom module in the back-end, I followed a lot of tutorials, but I continue to get 404 error when I try to access to my controller. The only thing that work fine is the menu option, but when I go to http:/admin_host/macrocategorie/config/ I get Page not found 404



    I have already tried to run this command:




    • php bin/magento setup:upgrade

    • php bin/magento setup:di:compile

    • php bin/magento cache:clean

    • php bin/magento cache:flush


    But nothing change.



    I have used below code :



    VendorModuleregistration.php



    <?php      MagentoFrameworkComponentComponentRegistrar::register(
    MagentoFrameworkComponentComponentRegistrar::MODULE,
    'Vendor_Module',
    __DIR__ );


    VendorModuleetcmodule.xml



    <?xml version="1.0"?><config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd">
    <module name="Vendor_Module" setup_version="2.0.0"/></config>


    VendorModuleetcadminhtmlroutes.xml



    <?xml version="1.0"?><config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd">
    <router id="admin">
    <route id="macrocategorie" frontName="macrocategorie">
    <module name="Vendor_Module" before="Magento_Backend"/>
    </route>
    </router></config>


    VendorModuleetcadminhtmlmenu.xml



    <?xml version="1.0"?><config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Magento/Backend/etc/menu.xsd">
    <menu>
    <add
    id="Vendor_Module::macrocategorie"
    title="Macrocategorie"
    module="Vendor_Module"
    sortOrder="100"
    parent="Magento_Backend::stores"
    resource="Vendor_Module::macrocategorie"
    />
    <add
    id="Vendor_Module::config"
    title="Configura Macrocategorie"
    module="Vendor_Module"
    sortOrder="105"
    parent="Vendor_Module::macrocategorie"
    action="macrocategorie/config/"
    resource="Vendor_Module::index"
    />
    </menu></config>


    VendorModuleControllerAdminhtmlConfigIndex.php



    <?php namespace VendorModuleControllerAdminhtmlConfig; use MagentoBackendAppActionContext; use MagentoFrameworkAppResponseInterface; use MagentoFrameworkViewResultPageFactory; class Index extends MagentoBackendAppAction {

    protected $resultPageFactory;

    public function __construct(
    Context $context,
    PageFactory $resultPageFactory
    )
    {
    parent::__construct($context);
    $this->resultPageFactory = $resultPageFactory;
    }

    /**
    * Dispatch request
    *
    * @return MagentoFrameworkControllerResultInterface|ResponseInterface
    * @throws MagentoFrameworkExceptionNotFoundException
    */
    public function execute()
    {
    die("Controller backend");
    $resultPage = $this->resultPageFactory->create();

    return $resultPage;
    } }


    Thank's for the support










    share|improve this question
















    bumped to the homepage by Community yesterday


    This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.


















      5












      5








      5


      1





      I'm trying to create my custom module in the back-end, I followed a lot of tutorials, but I continue to get 404 error when I try to access to my controller. The only thing that work fine is the menu option, but when I go to http:/admin_host/macrocategorie/config/ I get Page not found 404



      I have already tried to run this command:




      • php bin/magento setup:upgrade

      • php bin/magento setup:di:compile

      • php bin/magento cache:clean

      • php bin/magento cache:flush


      But nothing change.



      I have used below code :



      VendorModuleregistration.php



      <?php      MagentoFrameworkComponentComponentRegistrar::register(
      MagentoFrameworkComponentComponentRegistrar::MODULE,
      'Vendor_Module',
      __DIR__ );


      VendorModuleetcmodule.xml



      <?xml version="1.0"?><config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd">
      <module name="Vendor_Module" setup_version="2.0.0"/></config>


      VendorModuleetcadminhtmlroutes.xml



      <?xml version="1.0"?><config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd">
      <router id="admin">
      <route id="macrocategorie" frontName="macrocategorie">
      <module name="Vendor_Module" before="Magento_Backend"/>
      </route>
      </router></config>


      VendorModuleetcadminhtmlmenu.xml



      <?xml version="1.0"?><config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Magento/Backend/etc/menu.xsd">
      <menu>
      <add
      id="Vendor_Module::macrocategorie"
      title="Macrocategorie"
      module="Vendor_Module"
      sortOrder="100"
      parent="Magento_Backend::stores"
      resource="Vendor_Module::macrocategorie"
      />
      <add
      id="Vendor_Module::config"
      title="Configura Macrocategorie"
      module="Vendor_Module"
      sortOrder="105"
      parent="Vendor_Module::macrocategorie"
      action="macrocategorie/config/"
      resource="Vendor_Module::index"
      />
      </menu></config>


      VendorModuleControllerAdminhtmlConfigIndex.php



      <?php namespace VendorModuleControllerAdminhtmlConfig; use MagentoBackendAppActionContext; use MagentoFrameworkAppResponseInterface; use MagentoFrameworkViewResultPageFactory; class Index extends MagentoBackendAppAction {

      protected $resultPageFactory;

      public function __construct(
      Context $context,
      PageFactory $resultPageFactory
      )
      {
      parent::__construct($context);
      $this->resultPageFactory = $resultPageFactory;
      }

      /**
      * Dispatch request
      *
      * @return MagentoFrameworkControllerResultInterface|ResponseInterface
      * @throws MagentoFrameworkExceptionNotFoundException
      */
      public function execute()
      {
      die("Controller backend");
      $resultPage = $this->resultPageFactory->create();

      return $resultPage;
      } }


      Thank's for the support










      share|improve this question















      I'm trying to create my custom module in the back-end, I followed a lot of tutorials, but I continue to get 404 error when I try to access to my controller. The only thing that work fine is the menu option, but when I go to http:/admin_host/macrocategorie/config/ I get Page not found 404



      I have already tried to run this command:




      • php bin/magento setup:upgrade

      • php bin/magento setup:di:compile

      • php bin/magento cache:clean

      • php bin/magento cache:flush


      But nothing change.



      I have used below code :



      VendorModuleregistration.php



      <?php      MagentoFrameworkComponentComponentRegistrar::register(
      MagentoFrameworkComponentComponentRegistrar::MODULE,
      'Vendor_Module',
      __DIR__ );


      VendorModuleetcmodule.xml



      <?xml version="1.0"?><config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd">
      <module name="Vendor_Module" setup_version="2.0.0"/></config>


      VendorModuleetcadminhtmlroutes.xml



      <?xml version="1.0"?><config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd">
      <router id="admin">
      <route id="macrocategorie" frontName="macrocategorie">
      <module name="Vendor_Module" before="Magento_Backend"/>
      </route>
      </router></config>


      VendorModuleetcadminhtmlmenu.xml



      <?xml version="1.0"?><config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Magento/Backend/etc/menu.xsd">
      <menu>
      <add
      id="Vendor_Module::macrocategorie"
      title="Macrocategorie"
      module="Vendor_Module"
      sortOrder="100"
      parent="Magento_Backend::stores"
      resource="Vendor_Module::macrocategorie"
      />
      <add
      id="Vendor_Module::config"
      title="Configura Macrocategorie"
      module="Vendor_Module"
      sortOrder="105"
      parent="Vendor_Module::macrocategorie"
      action="macrocategorie/config/"
      resource="Vendor_Module::index"
      />
      </menu></config>


      VendorModuleControllerAdminhtmlConfigIndex.php



      <?php namespace VendorModuleControllerAdminhtmlConfig; use MagentoBackendAppActionContext; use MagentoFrameworkAppResponseInterface; use MagentoFrameworkViewResultPageFactory; class Index extends MagentoBackendAppAction {

      protected $resultPageFactory;

      public function __construct(
      Context $context,
      PageFactory $resultPageFactory
      )
      {
      parent::__construct($context);
      $this->resultPageFactory = $resultPageFactory;
      }

      /**
      * Dispatch request
      *
      * @return MagentoFrameworkControllerResultInterface|ResponseInterface
      * @throws MagentoFrameworkExceptionNotFoundException
      */
      public function execute()
      {
      die("Controller backend");
      $resultPage = $this->resultPageFactory->create();

      return $resultPage;
      } }


      Thank's for the support







      magento2 php module xml admin-controller






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Sep 22 '18 at 5:46









      Evince Development

      1,074318




      1,074318










      asked Oct 11 '16 at 13:51









      3tech - Alessandro Staffolani3tech - Alessandro Staffolani

      375721




      375721





      bumped to the homepage by Community yesterday


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







      bumped to the homepage by Community yesterday


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
























          4 Answers
          4






          active

          oldest

          votes


















          0














          It's probably because you're missing the ACL for your route.



          You need to create etc/acl.xml with the following content:



          <?xml version="1.0"?>
          <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Acl/etc/acl.xsd">
          <acl>
          <resources>
          <resource id="Magento_Backend::admin">
          <resource id="Magento_Backend::stores">
          <resource id="Vendor_Module::macrocategorie" title="Macrocategorie" sortOrder="80">
          <resource id="Vendor_Module::index" title="Configura Macrocategorie" sortOrder="80">
          </resource>
          </resource>
          </resource>
          </resources>
          </acl>
          </config>


          And then you need to add the following to your action class:



          protected function _isAllowed()
          {
          return $this->_authorization->isAllowed('Vendor_Module::index');
          }





          share|improve this answer





















          • In the Role Resources I could find my module but I still get the same error, 404 not found navigating to it. After adding the acl I also run the command php bin/magento cache:clean
            – 3tech - Alessandro Staffolani
            Oct 11 '16 at 14:17





















          0














          you try to change namespace from "SaturThemeConfiguration" to "VendorModule" in your Controller and then clear cache






          share|improve this answer





















          • Well SaturThemeConfiguration is the real name of my vendor and my module, when I wrote this article I forgot to change it in namespace
            – 3tech - Alessandro Staffolani
            Oct 11 '16 at 16:16










          • Now I edited it
            – 3tech - Alessandro Staffolani
            Oct 11 '16 at 16:18










          • I tried to test your module and it working. I cleaned cache and deleted var/generation folder and run setup:di:compile.
            – User14000
            Oct 12 '16 at 3:10










          • I tryed to remove and install again the module, now It works, I don't know why
            – 3tech - Alessandro Staffolani
            Oct 12 '16 at 12:46



















          0














          Replace your Index.php controller file code.



          <?php
          namespace VendorModuleControllerAdminhtmlConfig;

          class Index extends MagentoBackendAppAction {

          protected $resultLayoutFactory;

          public function __construct(
          MagentoBackendAppActionContext $context,
          MagentoFrameworkViewResultLayoutFactory $resultLayoutFactory
          )
          {
          parent::__construct($context);
          $this->resultLayoutFactory = $resultLayoutFactory;
          }

          /**
          * Dispatch request
          *
          * @return MagentoFrameworkControllerResultInterface|ResponseInterface
          * @throws MagentoFrameworkExceptionNotFoundException
          */
          public function execute()
          {
          die("Controller backend");
          $resultPage = $this->resultPageFactory->create();

          return $resultPage;
          }
          }


          Now working for you, Let me know if you have any issue with.






          share|improve this answer





















          • Hi, I solved removing and installing again the module
            – 3tech - Alessandro Staffolani
            Oct 12 '16 at 12:47










          • Solved without any code modification ?
            – Suresh Chikani
            Oct 12 '16 at 12:48










          • Yes I rewrite all the name of the vendor and module, maybe before something was wrong
            – 3tech - Alessandro Staffolani
            Oct 12 '16 at 13:06



















          0














          Like Raphael's answer, the acl file seems missing.



          Also, the menu does not need the second add node and this could break the first node that seems good enough to me.



          the _isAllowed function is mentioned in Raphael's post but I can't see any update in your post.



          I have added a module in a public repo that shows a backend screen. Please take a look at backend screen






          share|improve this answer





















            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "479"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f140305%2fmagento-2-backend-custom-module-404-error%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            4 Answers
            4






            active

            oldest

            votes








            4 Answers
            4






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            It's probably because you're missing the ACL for your route.



            You need to create etc/acl.xml with the following content:



            <?xml version="1.0"?>
            <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Acl/etc/acl.xsd">
            <acl>
            <resources>
            <resource id="Magento_Backend::admin">
            <resource id="Magento_Backend::stores">
            <resource id="Vendor_Module::macrocategorie" title="Macrocategorie" sortOrder="80">
            <resource id="Vendor_Module::index" title="Configura Macrocategorie" sortOrder="80">
            </resource>
            </resource>
            </resource>
            </resources>
            </acl>
            </config>


            And then you need to add the following to your action class:



            protected function _isAllowed()
            {
            return $this->_authorization->isAllowed('Vendor_Module::index');
            }





            share|improve this answer





















            • In the Role Resources I could find my module but I still get the same error, 404 not found navigating to it. After adding the acl I also run the command php bin/magento cache:clean
              – 3tech - Alessandro Staffolani
              Oct 11 '16 at 14:17


















            0














            It's probably because you're missing the ACL for your route.



            You need to create etc/acl.xml with the following content:



            <?xml version="1.0"?>
            <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Acl/etc/acl.xsd">
            <acl>
            <resources>
            <resource id="Magento_Backend::admin">
            <resource id="Magento_Backend::stores">
            <resource id="Vendor_Module::macrocategorie" title="Macrocategorie" sortOrder="80">
            <resource id="Vendor_Module::index" title="Configura Macrocategorie" sortOrder="80">
            </resource>
            </resource>
            </resource>
            </resources>
            </acl>
            </config>


            And then you need to add the following to your action class:



            protected function _isAllowed()
            {
            return $this->_authorization->isAllowed('Vendor_Module::index');
            }





            share|improve this answer





















            • In the Role Resources I could find my module but I still get the same error, 404 not found navigating to it. After adding the acl I also run the command php bin/magento cache:clean
              – 3tech - Alessandro Staffolani
              Oct 11 '16 at 14:17
















            0












            0








            0






            It's probably because you're missing the ACL for your route.



            You need to create etc/acl.xml with the following content:



            <?xml version="1.0"?>
            <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Acl/etc/acl.xsd">
            <acl>
            <resources>
            <resource id="Magento_Backend::admin">
            <resource id="Magento_Backend::stores">
            <resource id="Vendor_Module::macrocategorie" title="Macrocategorie" sortOrder="80">
            <resource id="Vendor_Module::index" title="Configura Macrocategorie" sortOrder="80">
            </resource>
            </resource>
            </resource>
            </resources>
            </acl>
            </config>


            And then you need to add the following to your action class:



            protected function _isAllowed()
            {
            return $this->_authorization->isAllowed('Vendor_Module::index');
            }





            share|improve this answer












            It's probably because you're missing the ACL for your route.



            You need to create etc/acl.xml with the following content:



            <?xml version="1.0"?>
            <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Acl/etc/acl.xsd">
            <acl>
            <resources>
            <resource id="Magento_Backend::admin">
            <resource id="Magento_Backend::stores">
            <resource id="Vendor_Module::macrocategorie" title="Macrocategorie" sortOrder="80">
            <resource id="Vendor_Module::index" title="Configura Macrocategorie" sortOrder="80">
            </resource>
            </resource>
            </resource>
            </resources>
            </acl>
            </config>


            And then you need to add the following to your action class:



            protected function _isAllowed()
            {
            return $this->_authorization->isAllowed('Vendor_Module::index');
            }






            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Oct 11 '16 at 13:58









            Raphael at Digital PianismRaphael at Digital Pianism

            53.4k19111269




            53.4k19111269












            • In the Role Resources I could find my module but I still get the same error, 404 not found navigating to it. After adding the acl I also run the command php bin/magento cache:clean
              – 3tech - Alessandro Staffolani
              Oct 11 '16 at 14:17




















            • In the Role Resources I could find my module but I still get the same error, 404 not found navigating to it. After adding the acl I also run the command php bin/magento cache:clean
              – 3tech - Alessandro Staffolani
              Oct 11 '16 at 14:17


















            In the Role Resources I could find my module but I still get the same error, 404 not found navigating to it. After adding the acl I also run the command php bin/magento cache:clean
            – 3tech - Alessandro Staffolani
            Oct 11 '16 at 14:17






            In the Role Resources I could find my module but I still get the same error, 404 not found navigating to it. After adding the acl I also run the command php bin/magento cache:clean
            – 3tech - Alessandro Staffolani
            Oct 11 '16 at 14:17















            0














            you try to change namespace from "SaturThemeConfiguration" to "VendorModule" in your Controller and then clear cache






            share|improve this answer





















            • Well SaturThemeConfiguration is the real name of my vendor and my module, when I wrote this article I forgot to change it in namespace
              – 3tech - Alessandro Staffolani
              Oct 11 '16 at 16:16










            • Now I edited it
              – 3tech - Alessandro Staffolani
              Oct 11 '16 at 16:18










            • I tried to test your module and it working. I cleaned cache and deleted var/generation folder and run setup:di:compile.
              – User14000
              Oct 12 '16 at 3:10










            • I tryed to remove and install again the module, now It works, I don't know why
              – 3tech - Alessandro Staffolani
              Oct 12 '16 at 12:46
















            0














            you try to change namespace from "SaturThemeConfiguration" to "VendorModule" in your Controller and then clear cache






            share|improve this answer





















            • Well SaturThemeConfiguration is the real name of my vendor and my module, when I wrote this article I forgot to change it in namespace
              – 3tech - Alessandro Staffolani
              Oct 11 '16 at 16:16










            • Now I edited it
              – 3tech - Alessandro Staffolani
              Oct 11 '16 at 16:18










            • I tried to test your module and it working. I cleaned cache and deleted var/generation folder and run setup:di:compile.
              – User14000
              Oct 12 '16 at 3:10










            • I tryed to remove and install again the module, now It works, I don't know why
              – 3tech - Alessandro Staffolani
              Oct 12 '16 at 12:46














            0












            0








            0






            you try to change namespace from "SaturThemeConfiguration" to "VendorModule" in your Controller and then clear cache






            share|improve this answer












            you try to change namespace from "SaturThemeConfiguration" to "VendorModule" in your Controller and then clear cache







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Oct 11 '16 at 15:44









            User14000User14000

            12




            12












            • Well SaturThemeConfiguration is the real name of my vendor and my module, when I wrote this article I forgot to change it in namespace
              – 3tech - Alessandro Staffolani
              Oct 11 '16 at 16:16










            • Now I edited it
              – 3tech - Alessandro Staffolani
              Oct 11 '16 at 16:18










            • I tried to test your module and it working. I cleaned cache and deleted var/generation folder and run setup:di:compile.
              – User14000
              Oct 12 '16 at 3:10










            • I tryed to remove and install again the module, now It works, I don't know why
              – 3tech - Alessandro Staffolani
              Oct 12 '16 at 12:46


















            • Well SaturThemeConfiguration is the real name of my vendor and my module, when I wrote this article I forgot to change it in namespace
              – 3tech - Alessandro Staffolani
              Oct 11 '16 at 16:16










            • Now I edited it
              – 3tech - Alessandro Staffolani
              Oct 11 '16 at 16:18










            • I tried to test your module and it working. I cleaned cache and deleted var/generation folder and run setup:di:compile.
              – User14000
              Oct 12 '16 at 3:10










            • I tryed to remove and install again the module, now It works, I don't know why
              – 3tech - Alessandro Staffolani
              Oct 12 '16 at 12:46
















            Well SaturThemeConfiguration is the real name of my vendor and my module, when I wrote this article I forgot to change it in namespace
            – 3tech - Alessandro Staffolani
            Oct 11 '16 at 16:16




            Well SaturThemeConfiguration is the real name of my vendor and my module, when I wrote this article I forgot to change it in namespace
            – 3tech - Alessandro Staffolani
            Oct 11 '16 at 16:16












            Now I edited it
            – 3tech - Alessandro Staffolani
            Oct 11 '16 at 16:18




            Now I edited it
            – 3tech - Alessandro Staffolani
            Oct 11 '16 at 16:18












            I tried to test your module and it working. I cleaned cache and deleted var/generation folder and run setup:di:compile.
            – User14000
            Oct 12 '16 at 3:10




            I tried to test your module and it working. I cleaned cache and deleted var/generation folder and run setup:di:compile.
            – User14000
            Oct 12 '16 at 3:10












            I tryed to remove and install again the module, now It works, I don't know why
            – 3tech - Alessandro Staffolani
            Oct 12 '16 at 12:46




            I tryed to remove and install again the module, now It works, I don't know why
            – 3tech - Alessandro Staffolani
            Oct 12 '16 at 12:46











            0














            Replace your Index.php controller file code.



            <?php
            namespace VendorModuleControllerAdminhtmlConfig;

            class Index extends MagentoBackendAppAction {

            protected $resultLayoutFactory;

            public function __construct(
            MagentoBackendAppActionContext $context,
            MagentoFrameworkViewResultLayoutFactory $resultLayoutFactory
            )
            {
            parent::__construct($context);
            $this->resultLayoutFactory = $resultLayoutFactory;
            }

            /**
            * Dispatch request
            *
            * @return MagentoFrameworkControllerResultInterface|ResponseInterface
            * @throws MagentoFrameworkExceptionNotFoundException
            */
            public function execute()
            {
            die("Controller backend");
            $resultPage = $this->resultPageFactory->create();

            return $resultPage;
            }
            }


            Now working for you, Let me know if you have any issue with.






            share|improve this answer





















            • Hi, I solved removing and installing again the module
              – 3tech - Alessandro Staffolani
              Oct 12 '16 at 12:47










            • Solved without any code modification ?
              – Suresh Chikani
              Oct 12 '16 at 12:48










            • Yes I rewrite all the name of the vendor and module, maybe before something was wrong
              – 3tech - Alessandro Staffolani
              Oct 12 '16 at 13:06
















            0














            Replace your Index.php controller file code.



            <?php
            namespace VendorModuleControllerAdminhtmlConfig;

            class Index extends MagentoBackendAppAction {

            protected $resultLayoutFactory;

            public function __construct(
            MagentoBackendAppActionContext $context,
            MagentoFrameworkViewResultLayoutFactory $resultLayoutFactory
            )
            {
            parent::__construct($context);
            $this->resultLayoutFactory = $resultLayoutFactory;
            }

            /**
            * Dispatch request
            *
            * @return MagentoFrameworkControllerResultInterface|ResponseInterface
            * @throws MagentoFrameworkExceptionNotFoundException
            */
            public function execute()
            {
            die("Controller backend");
            $resultPage = $this->resultPageFactory->create();

            return $resultPage;
            }
            }


            Now working for you, Let me know if you have any issue with.






            share|improve this answer





















            • Hi, I solved removing and installing again the module
              – 3tech - Alessandro Staffolani
              Oct 12 '16 at 12:47










            • Solved without any code modification ?
              – Suresh Chikani
              Oct 12 '16 at 12:48










            • Yes I rewrite all the name of the vendor and module, maybe before something was wrong
              – 3tech - Alessandro Staffolani
              Oct 12 '16 at 13:06














            0












            0








            0






            Replace your Index.php controller file code.



            <?php
            namespace VendorModuleControllerAdminhtmlConfig;

            class Index extends MagentoBackendAppAction {

            protected $resultLayoutFactory;

            public function __construct(
            MagentoBackendAppActionContext $context,
            MagentoFrameworkViewResultLayoutFactory $resultLayoutFactory
            )
            {
            parent::__construct($context);
            $this->resultLayoutFactory = $resultLayoutFactory;
            }

            /**
            * Dispatch request
            *
            * @return MagentoFrameworkControllerResultInterface|ResponseInterface
            * @throws MagentoFrameworkExceptionNotFoundException
            */
            public function execute()
            {
            die("Controller backend");
            $resultPage = $this->resultPageFactory->create();

            return $resultPage;
            }
            }


            Now working for you, Let me know if you have any issue with.






            share|improve this answer












            Replace your Index.php controller file code.



            <?php
            namespace VendorModuleControllerAdminhtmlConfig;

            class Index extends MagentoBackendAppAction {

            protected $resultLayoutFactory;

            public function __construct(
            MagentoBackendAppActionContext $context,
            MagentoFrameworkViewResultLayoutFactory $resultLayoutFactory
            )
            {
            parent::__construct($context);
            $this->resultLayoutFactory = $resultLayoutFactory;
            }

            /**
            * Dispatch request
            *
            * @return MagentoFrameworkControllerResultInterface|ResponseInterface
            * @throws MagentoFrameworkExceptionNotFoundException
            */
            public function execute()
            {
            die("Controller backend");
            $resultPage = $this->resultPageFactory->create();

            return $resultPage;
            }
            }


            Now working for you, Let me know if you have any issue with.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Oct 12 '16 at 12:20









            Suresh ChikaniSuresh Chikani

            9,85053270




            9,85053270












            • Hi, I solved removing and installing again the module
              – 3tech - Alessandro Staffolani
              Oct 12 '16 at 12:47










            • Solved without any code modification ?
              – Suresh Chikani
              Oct 12 '16 at 12:48










            • Yes I rewrite all the name of the vendor and module, maybe before something was wrong
              – 3tech - Alessandro Staffolani
              Oct 12 '16 at 13:06


















            • Hi, I solved removing and installing again the module
              – 3tech - Alessandro Staffolani
              Oct 12 '16 at 12:47










            • Solved without any code modification ?
              – Suresh Chikani
              Oct 12 '16 at 12:48










            • Yes I rewrite all the name of the vendor and module, maybe before something was wrong
              – 3tech - Alessandro Staffolani
              Oct 12 '16 at 13:06
















            Hi, I solved removing and installing again the module
            – 3tech - Alessandro Staffolani
            Oct 12 '16 at 12:47




            Hi, I solved removing and installing again the module
            – 3tech - Alessandro Staffolani
            Oct 12 '16 at 12:47












            Solved without any code modification ?
            – Suresh Chikani
            Oct 12 '16 at 12:48




            Solved without any code modification ?
            – Suresh Chikani
            Oct 12 '16 at 12:48












            Yes I rewrite all the name of the vendor and module, maybe before something was wrong
            – 3tech - Alessandro Staffolani
            Oct 12 '16 at 13:06




            Yes I rewrite all the name of the vendor and module, maybe before something was wrong
            – 3tech - Alessandro Staffolani
            Oct 12 '16 at 13:06











            0














            Like Raphael's answer, the acl file seems missing.



            Also, the menu does not need the second add node and this could break the first node that seems good enough to me.



            the _isAllowed function is mentioned in Raphael's post but I can't see any update in your post.



            I have added a module in a public repo that shows a backend screen. Please take a look at backend screen






            share|improve this answer


























              0














              Like Raphael's answer, the acl file seems missing.



              Also, the menu does not need the second add node and this could break the first node that seems good enough to me.



              the _isAllowed function is mentioned in Raphael's post but I can't see any update in your post.



              I have added a module in a public repo that shows a backend screen. Please take a look at backend screen






              share|improve this answer
























                0












                0








                0






                Like Raphael's answer, the acl file seems missing.



                Also, the menu does not need the second add node and this could break the first node that seems good enough to me.



                the _isAllowed function is mentioned in Raphael's post but I can't see any update in your post.



                I have added a module in a public repo that shows a backend screen. Please take a look at backend screen






                share|improve this answer












                Like Raphael's answer, the acl file seems missing.



                Also, the menu does not need the second add node and this could break the first node that seems good enough to me.



                the _isAllowed function is mentioned in Raphael's post but I can't see any update in your post.



                I have added a module in a public repo that shows a backend screen. Please take a look at backend screen







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Nov 24 '18 at 8:55









                Herve TribouilloyHerve Tribouilloy

                1,224410




                1,224410






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Magento Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.





                    Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                    Please pay close attention to the following guidance:


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f140305%2fmagento-2-backend-custom-module-404-error%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    1300-talet

                    1300-talet

                    Display a custom attribute below product name in the front-end Magento 1.9.3.8