1

I have a custom module with backend management.

I have an observer on config save that uses the file upload to read submitted file to update the collection however this fails due to below;

class \My\MODULE\Model\Grid does not exist

Caused by, for some reason, when compile/content-deply is run and the generation is creating the GridFactory in;

generated\code\My\MODULE\Model\GridFactory.php
// ** should be in generated\code\My\Module\Model\GridFactory.php **

This is the issue, not sure why this is both capitalizing the Module name & then of course, generating this into incorrect location hence breaking any functionality (although admin forms are working for this module on save) and I can see other generation items are created in the correct location.

I have other modules copied & refactored/renamed but are not having the same issue at all...

0

Found the solution to my own mistake...

As I am integrating My/Module GridFactory into another module via dependency injection, it was here that I was adding the injection where the incorrect naming was written/injected as per below;

//adding dep. injection to My\OtherModule\Helper\Data.php
//see below mistake of capitalization in naming injection

public function __construct(

    \Magento\Framework\App\Helper\Context $context,
    \Magento\Customer\Model\Session $customerSession,
    \My\MODULE\Model\GridFactory $gridFactory

) 

Updating to the correct naming and running CLI commands to update/clean/generate fixed the issues on the backend.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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