Magento 2.2 - Problem with Helper class not found in custom module The 2019 Stack Overflow Developer Survey Results Are InUpgrading to Magento 2.0.5 gives Class 'cms/block' not foundModel class not found in …/magento/framework/ObjectManager/Factory/AbstractFactory.php:93Magento2: Products group by filterable attributesMagento 2: Plugin class does not existUnable to create order from admin in magento 2How to install extension using composer - Magento EE 2.2 ( Production )Getting Fatal error: Class 'IntlDateFormatter' not found in Magento2Magento2 REST API get all customers detailsMagento 2 ErrorI am getting this error when I installed algolia search module

FPGA - DIY Programming

Can one be advised by a professor who is very far away?

How to notate time signature switching consistently every measure

Why isn't the circumferential light around the M87 black hole's event horizon symmetric?

During Temple times, who can butcher a kosher animal?

Why hard-Brexiteers don't insist on a hard border to prevent illegal immigration after Brexit?

Can someone be penalized for an "unlawful" act if no penalty is specified?

Why didn't the Event Horizon Telescope team mention Sagittarius A*?

Did 3000BC Egyptians use meteoric iron weapons?

Does the shape of a die affect the probability of a number being rolled?

Protecting Dualbooting Windows from dangerous code (like rm -rf)

Are there incongruent pythagorean triangles with the same perimeter and same area?

Should I use my personal e-mail address, or my workplace one, when registering to external websites for work purposes?

What is the meaning of the verb "bear" in this context?

Why did Acorn's A3000 have red function keys?

Are spiders unable to hurt humans, especially very small spiders?

Is there any way to tell whether the shot is going to hit you or not?

Do these rules for Critical Successes and Critical Failures seem Fair?

Can a flute soloist sit?

Why not take a picture of a closer black hole?

Is "plugging out" electronic devices an American expression?

Can you compress metal and what would be the consequences?

What do hard-Brexiteers want with respect to the Irish border?

How to type this arrow in math mode?



Magento 2.2 - Problem with Helper class not found in custom module



The 2019 Stack Overflow Developer Survey Results Are InUpgrading to Magento 2.0.5 gives Class 'cms/block' not foundModel class not found in …/magento/framework/ObjectManager/Factory/AbstractFactory.php:93Magento2: Products group by filterable attributesMagento 2: Plugin class does not existUnable to create order from admin in magento 2How to install extension using composer - Magento EE 2.2 ( Production )Getting Fatal error: Class 'IntlDateFormatter' not found in Magento2Magento2 REST API get all customers detailsMagento 2 ErrorI am getting this error when I installed algolia search module



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








2















I'm creating a payment module and I'm having a curious problem. I started by creating the module inside the app/code/Vendorname/Payment folder for convenience. It is not yet complete, but the system.xml settings options were working correctly and all configurations can be changes in admin.



One of the system.xml fields has a custom source model, where I used the module's helper and everything was ok.



So for now I created a repository in github, and put the module so that I could use the composer (and remove it from the app/code folder). I did this by thinking of leaving the module in a way that can be replicated in other stores, so with better distribution way.



However after installing with composer (and after did all upgrade and compile di things on shell), when accessing the configuration section in the admin panel I always get the error below.



Fatal error: Uncaught Error: Class 'VendornamePaymentHelperData' not found in /Users/username/sites/vendornamem2/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:111 
Stack trace:
#0 /Users/username/sites/vendornamem2/vendor/magento/framework/ObjectManager/Factory/Compiled.php(108): MagentoFrameworkObjectManagerFactoryAbstractFactory->createObject('Vendorname\Payment\...', Array)
#1 /Users/username/sites/vendornamem2/vendor/magento/framework/ObjectManager/Factory/Compiled.php(150): MagentoFrameworkObjectManagerFactoryCompiled->create('Vendorname\Payment\...')
#2 /Users/username/sites/vendornamem2/vendor/magento/framework/ObjectManager/Factory/Compiled.php(79): MagentoFrameworkObjectManagerFactoryCompiled->get('Vendorname\Payment\...')
#3 /Users/username/sites/vendornamem2/vendor/magento/framework/ObjectManager/ObjectManager.php(70): MagentoFrameworkObjectManagerFactoryCompiled->create('Vendorname\Payment\...')
#4 /Users/username/sites/vendornamem2/vendor/magento/module-config/Model/Config/SourceFactory.php(37): MagentoFr in /Users/username/sites/vendornamem2/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php on line 111


Apparently the helper is not being found in my custom field class. They follow the source model of the field in question (Mode).



<?php
namespace VendornamePaymentModelSource;

class Mode implements MagentoFrameworkOptionArrayInterface

/**
* @var VendornamePaymentHelperData
*/
protected $_paymentHelper;

/**
* Mode constructor.
*
* @param VendornamePaymentHelperData $paymentHelper
*/
public function __construct(
VendornamePaymentHelperData $paymentHelper
)
$this->_paymentHelper = $paymentHelper;


public function toOptionArray()

/** @var VendornamePaymentHelperData $VendornameHelper */
$VendornameHelper = $this->_paymentHelper;
return [
['value' => $VendornameHelper::ONPAGE_MODE, 'label' => 'On Page'],
['value' => $VendornameHelper::IFRAME_MODE, 'label' => 'Iframe'],
['value' => $VendornameHelper::REDIRECT_MODE, 'label' => 'Redirect']
];




The error came after simply by migrating the code from the app/code folder to the composer. Not even one character was modified in the process. Is there any helper mapping that needs to be done?










share|improve this question






























    2















    I'm creating a payment module and I'm having a curious problem. I started by creating the module inside the app/code/Vendorname/Payment folder for convenience. It is not yet complete, but the system.xml settings options were working correctly and all configurations can be changes in admin.



    One of the system.xml fields has a custom source model, where I used the module's helper and everything was ok.



    So for now I created a repository in github, and put the module so that I could use the composer (and remove it from the app/code folder). I did this by thinking of leaving the module in a way that can be replicated in other stores, so with better distribution way.



    However after installing with composer (and after did all upgrade and compile di things on shell), when accessing the configuration section in the admin panel I always get the error below.



    Fatal error: Uncaught Error: Class 'VendornamePaymentHelperData' not found in /Users/username/sites/vendornamem2/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:111 
    Stack trace:
    #0 /Users/username/sites/vendornamem2/vendor/magento/framework/ObjectManager/Factory/Compiled.php(108): MagentoFrameworkObjectManagerFactoryAbstractFactory->createObject('Vendorname\Payment\...', Array)
    #1 /Users/username/sites/vendornamem2/vendor/magento/framework/ObjectManager/Factory/Compiled.php(150): MagentoFrameworkObjectManagerFactoryCompiled->create('Vendorname\Payment\...')
    #2 /Users/username/sites/vendornamem2/vendor/magento/framework/ObjectManager/Factory/Compiled.php(79): MagentoFrameworkObjectManagerFactoryCompiled->get('Vendorname\Payment\...')
    #3 /Users/username/sites/vendornamem2/vendor/magento/framework/ObjectManager/ObjectManager.php(70): MagentoFrameworkObjectManagerFactoryCompiled->create('Vendorname\Payment\...')
    #4 /Users/username/sites/vendornamem2/vendor/magento/module-config/Model/Config/SourceFactory.php(37): MagentoFr in /Users/username/sites/vendornamem2/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php on line 111


    Apparently the helper is not being found in my custom field class. They follow the source model of the field in question (Mode).



    <?php
    namespace VendornamePaymentModelSource;

    class Mode implements MagentoFrameworkOptionArrayInterface

    /**
    * @var VendornamePaymentHelperData
    */
    protected $_paymentHelper;

    /**
    * Mode constructor.
    *
    * @param VendornamePaymentHelperData $paymentHelper
    */
    public function __construct(
    VendornamePaymentHelperData $paymentHelper
    )
    $this->_paymentHelper = $paymentHelper;


    public function toOptionArray()

    /** @var VendornamePaymentHelperData $VendornameHelper */
    $VendornameHelper = $this->_paymentHelper;
    return [
    ['value' => $VendornameHelper::ONPAGE_MODE, 'label' => 'On Page'],
    ['value' => $VendornameHelper::IFRAME_MODE, 'label' => 'Iframe'],
    ['value' => $VendornameHelper::REDIRECT_MODE, 'label' => 'Redirect']
    ];




    The error came after simply by migrating the code from the app/code folder to the composer. Not even one character was modified in the process. Is there any helper mapping that needs to be done?










    share|improve this question


























      2












      2








      2








      I'm creating a payment module and I'm having a curious problem. I started by creating the module inside the app/code/Vendorname/Payment folder for convenience. It is not yet complete, but the system.xml settings options were working correctly and all configurations can be changes in admin.



      One of the system.xml fields has a custom source model, where I used the module's helper and everything was ok.



      So for now I created a repository in github, and put the module so that I could use the composer (and remove it from the app/code folder). I did this by thinking of leaving the module in a way that can be replicated in other stores, so with better distribution way.



      However after installing with composer (and after did all upgrade and compile di things on shell), when accessing the configuration section in the admin panel I always get the error below.



      Fatal error: Uncaught Error: Class 'VendornamePaymentHelperData' not found in /Users/username/sites/vendornamem2/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:111 
      Stack trace:
      #0 /Users/username/sites/vendornamem2/vendor/magento/framework/ObjectManager/Factory/Compiled.php(108): MagentoFrameworkObjectManagerFactoryAbstractFactory->createObject('Vendorname\Payment\...', Array)
      #1 /Users/username/sites/vendornamem2/vendor/magento/framework/ObjectManager/Factory/Compiled.php(150): MagentoFrameworkObjectManagerFactoryCompiled->create('Vendorname\Payment\...')
      #2 /Users/username/sites/vendornamem2/vendor/magento/framework/ObjectManager/Factory/Compiled.php(79): MagentoFrameworkObjectManagerFactoryCompiled->get('Vendorname\Payment\...')
      #3 /Users/username/sites/vendornamem2/vendor/magento/framework/ObjectManager/ObjectManager.php(70): MagentoFrameworkObjectManagerFactoryCompiled->create('Vendorname\Payment\...')
      #4 /Users/username/sites/vendornamem2/vendor/magento/module-config/Model/Config/SourceFactory.php(37): MagentoFr in /Users/username/sites/vendornamem2/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php on line 111


      Apparently the helper is not being found in my custom field class. They follow the source model of the field in question (Mode).



      <?php
      namespace VendornamePaymentModelSource;

      class Mode implements MagentoFrameworkOptionArrayInterface

      /**
      * @var VendornamePaymentHelperData
      */
      protected $_paymentHelper;

      /**
      * Mode constructor.
      *
      * @param VendornamePaymentHelperData $paymentHelper
      */
      public function __construct(
      VendornamePaymentHelperData $paymentHelper
      )
      $this->_paymentHelper = $paymentHelper;


      public function toOptionArray()

      /** @var VendornamePaymentHelperData $VendornameHelper */
      $VendornameHelper = $this->_paymentHelper;
      return [
      ['value' => $VendornameHelper::ONPAGE_MODE, 'label' => 'On Page'],
      ['value' => $VendornameHelper::IFRAME_MODE, 'label' => 'Iframe'],
      ['value' => $VendornameHelper::REDIRECT_MODE, 'label' => 'Redirect']
      ];




      The error came after simply by migrating the code from the app/code folder to the composer. Not even one character was modified in the process. Is there any helper mapping that needs to be done?










      share|improve this question
















      I'm creating a payment module and I'm having a curious problem. I started by creating the module inside the app/code/Vendorname/Payment folder for convenience. It is not yet complete, but the system.xml settings options were working correctly and all configurations can be changes in admin.



      One of the system.xml fields has a custom source model, where I used the module's helper and everything was ok.



      So for now I created a repository in github, and put the module so that I could use the composer (and remove it from the app/code folder). I did this by thinking of leaving the module in a way that can be replicated in other stores, so with better distribution way.



      However after installing with composer (and after did all upgrade and compile di things on shell), when accessing the configuration section in the admin panel I always get the error below.



      Fatal error: Uncaught Error: Class 'VendornamePaymentHelperData' not found in /Users/username/sites/vendornamem2/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:111 
      Stack trace:
      #0 /Users/username/sites/vendornamem2/vendor/magento/framework/ObjectManager/Factory/Compiled.php(108): MagentoFrameworkObjectManagerFactoryAbstractFactory->createObject('Vendorname\Payment\...', Array)
      #1 /Users/username/sites/vendornamem2/vendor/magento/framework/ObjectManager/Factory/Compiled.php(150): MagentoFrameworkObjectManagerFactoryCompiled->create('Vendorname\Payment\...')
      #2 /Users/username/sites/vendornamem2/vendor/magento/framework/ObjectManager/Factory/Compiled.php(79): MagentoFrameworkObjectManagerFactoryCompiled->get('Vendorname\Payment\...')
      #3 /Users/username/sites/vendornamem2/vendor/magento/framework/ObjectManager/ObjectManager.php(70): MagentoFrameworkObjectManagerFactoryCompiled->create('Vendorname\Payment\...')
      #4 /Users/username/sites/vendornamem2/vendor/magento/module-config/Model/Config/SourceFactory.php(37): MagentoFr in /Users/username/sites/vendornamem2/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php on line 111


      Apparently the helper is not being found in my custom field class. They follow the source model of the field in question (Mode).



      <?php
      namespace VendornamePaymentModelSource;

      class Mode implements MagentoFrameworkOptionArrayInterface

      /**
      * @var VendornamePaymentHelperData
      */
      protected $_paymentHelper;

      /**
      * Mode constructor.
      *
      * @param VendornamePaymentHelperData $paymentHelper
      */
      public function __construct(
      VendornamePaymentHelperData $paymentHelper
      )
      $this->_paymentHelper = $paymentHelper;


      public function toOptionArray()

      /** @var VendornamePaymentHelperData $VendornameHelper */
      $VendornameHelper = $this->_paymentHelper;
      return [
      ['value' => $VendornameHelper::ONPAGE_MODE, 'label' => 'On Page'],
      ['value' => $VendornameHelper::IFRAME_MODE, 'label' => 'Iframe'],
      ['value' => $VendornameHelper::REDIRECT_MODE, 'label' => 'Redirect']
      ];




      The error came after simply by migrating the code from the app/code folder to the composer. Not even one character was modified in the process. Is there any helper mapping that needs to be done?







      magento2 module magento2.2 extensions helper






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Apr 7 at 15:44







      Denis Spalenza

















      asked Apr 7 at 14:47









      Denis SpalenzaDenis Spalenza

      1,1381126




      1,1381126




















          1 Answer
          1






          active

          oldest

          votes


















          0














          I got it.



          I forgot map folder VendornamePayment on composer.json (psr-4 node). I added the following code and it works.



          "autoload": 
          "files": [
          "registration.php"
          ],
          "psr-4":
          "Vendorname\Payment\": ""







          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%2f269053%2fmagento-2-2-problem-with-helper-class-not-found-in-custom-module%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            I got it.



            I forgot map folder VendornamePayment on composer.json (psr-4 node). I added the following code and it works.



            "autoload": 
            "files": [
            "registration.php"
            ],
            "psr-4":
            "Vendorname\Payment\": ""







            share|improve this answer



























              0














              I got it.



              I forgot map folder VendornamePayment on composer.json (psr-4 node). I added the following code and it works.



              "autoload": 
              "files": [
              "registration.php"
              ],
              "psr-4":
              "Vendorname\Payment\": ""







              share|improve this answer

























                0












                0








                0







                I got it.



                I forgot map folder VendornamePayment on composer.json (psr-4 node). I added the following code and it works.



                "autoload": 
                "files": [
                "registration.php"
                ],
                "psr-4":
                "Vendorname\Payment\": ""







                share|improve this answer













                I got it.



                I forgot map folder VendornamePayment on composer.json (psr-4 node). I added the following code and it works.



                "autoload": 
                "files": [
                "registration.php"
                ],
                "psr-4":
                "Vendorname\Payment\": ""








                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Apr 7 at 15:52









                Denis SpalenzaDenis Spalenza

                1,1381126




                1,1381126



























                    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.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f269053%2fmagento-2-2-problem-with-helper-class-not-found-in-custom-module%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

                    Sum ergo cogito? 1 nng

                    三茅街道4182Guuntc Dn precexpngmageondP