0

I got this error while trying to access an admin page

    2 exception(s):
Exception #0 (Magento\Framework\Exception\LocalizedException): Invalid block type: WD\WarehousingCreditNote\Block\Adminhtml\Warehousingcreditnote\Edit\Form
Exception #1 (ReflectionException): Class WD\WarehousingCreditNote\Block\Adminhtml\Warehousingcreditnote\Edit\Form does not exist

Exception #0 (Magento\Framework\Exception\LocalizedException): Invalid block type: WD\WarehousingCreditNote\Block\Adminhtml\Warehousingcreditnote\Edit\Form
#0 /var/www/wd-magento/vendor/magento/framework/View/Layout/Generator/Block.php(237): Magento\Framework\View\Layout\Generator\Block->getBlockInstance('WD\\WarehousingC...', Array)
#1 /var/www/wd-magento/vendor/magento/framework/View/Layout.php(760): Magento\Framework\View\Layout\Generator\Block->createBlock('WD\\WarehousingC...', 'warehousing_cre...', Array)
#2 /var/www/wd-magento/vendor/magento/framework/View/Layout.php(743): Magento\Framework\View\Layout->_createBlock('WD\\WarehousingC...', 'warehousing_cre...', Array)
#3 /var/www/wd-magento/var/generation/Magento/Framework/View/Layout/Interceptor.php(349): Magento\Framework\View\Layout->createBlock('WD\\WarehousingC...', 'warehousing_cre...', Array)
#4 /var/www/wd-magento/vendor/magento/framework/View/Element/AbstractBlock.php(381): Magento\Framework\View\Layout\Interceptor->createBlock('WD\\WarehousingC...', 'warehousing_cre...', Array)
#5 /var/www/wd-magento/vendor/magento/module-backend/Block/Widget/Form/Container.php(108): Magento\Framework\View\Element\AbstractBlock->addChild('form', 'WD\\WarehousingC...')
#6 /var/www/wd-magento/app/code/WD/WarehousingCreditNote/Block/Adminhtml/WarehousingCreditNote/Edit.php(110): Magento\Backend\Block\Widget\Form\Container->_prepareLayout()
#7 /var/www/wd-magento/vendor/magento/framework/View/Element/AbstractBlock.php(264): WD\WarehousingCreditNote\Block\Adminhtml\WarehousingCreditNote\Edit->_prepareLayout()
#8 /var/www/wd-magento/vendor/magento/framework/View/Layout/Generator/Block.php(139): Magento\Framework\View\Element\AbstractBlock->setLayout(Object(Magento\Framework\View\Layout\Interceptor))
#9 /var/www/wd-magento/vendor/magento/framework/View/Layout/GeneratorPool.php(86): Magento\Framework\View\Layout\Generator\Block->process(Object(Magento\Framework\View\Layout\Reader\Context), Object(Magento\Framework\View\Layout\Generator\Context))
#10 /var/www/wd-magento/vendor/magento/framework/View/Layout.php(327): Magento\Framework\View\Layout\GeneratorPool->process(Object(Magento\Framework\View\Layout\Reader\Context), Object(Magento\Framework\View\Layout\Generator\Context))
#11 /var/www/wd-magento/var/generation/Magento/Framework/View/Layout/Interceptor.php(89): Magento\Framework\View\Layout->generateElements()
#12 /var/www/wd-magento/vendor/magento/framework/View/Layout/Builder.php(129): Magento\Framework\View\Layout\Interceptor->generateElements()
#13 /var/www/wd-magento/vendor/magento/framework/View/Page/Builder.php(55): Magento\Framework\View\Layout\Builder->generateLayoutBlocks()
#14 /var/www/wd-magento/vendor/magento/framework/View/Layout/Builder.php(65): Magento\Framework\View\Page\Builder->generateLayoutBlocks()
#15 /var/www/wd-magento/vendor/magento/framework/View/Layout.php(244): Magento\Framework\View\Layout\Builder->build()
#16 /var/www/wd-magento/vendor/magento/framework/View/Layout.php(859): Magento\Framework\View\Layout->build()
#17 /var/www/wd-magento/var/generation/Magento/Framework/View/Layout/Interceptor.php(414): Magento\Framework\View\Layout->getBlock('menu')
#18 /var/www/wd-magento/vendor/magento/module-backend/Model/View/Result/Page.php(59): Magento\Framework\View\Layout\Interceptor->getBlock('menu')
#19 /var/www/wd-magento/var/generation/Magento/Backend/Model/View/Result/Page/Interceptor.php(24): Magento\Backend\Model\View\Result\Page->setActiveMenu('WD_WarehousingC...')
#20 /var/www/wd-magento/app/code/WD/WarehousingCreditNote/Controller/Adminhtml/WarehousingCreditNote/Edit.php(56): Magento\Backend\Model\View\Result\Page\Interceptor->setActiveMenu('WD_WarehousingC...')
#21 /var/www/wd-magento/app/code/WD/WarehousingCreditNote/Controller/Adminhtml/WarehousingCreditNote/Edit.php(97): WD\WarehousingCreditNote\Controller\Adminhtml\WarehousingCreditNote\Edit->_initAction()
#22 /var/www/wd-magento/var/generation/WD/WarehousingCreditNote/Controller/Adminhtml/WarehousingCreditNote/Edit/Interceptor.php(24): WD\WarehousingCreditNote\Controller\Adminhtml\WarehousingCreditNote\Edit->execute()
#23 /var/www/wd-magento/vendor/magento/framework/App/Action/Action.php(102): WD\WarehousingCreditNote\Controller\Adminhtml\WarehousingCreditNote\Edit\Interceptor->execute()
#24 /var/www/wd-magento/vendor/magento/module-backend/App/AbstractAction.php(226): Magento\Framework\App\Action\Action->dispatch(Object(Magento\Framework\App\Request\Http))
#25 /var/www/wd-magento/vendor/magento/framework/Interception/Interceptor.php(74): Magento\Backend\App\AbstractAction->dispatch(Object(Magento\Framework\App\Request\Http))
#26 /var/www/wd-magento/vendor/magento/framework/Interception/Chain/Chain.php(70): WD\WarehousingCreditNote\Controller\Adminhtml\WarehousingCreditNote\Edit\Interceptor->___callParent('dispatch', Array)
#27 /var/www/wd-magento/vendor/magento/framework/Interception/Chain/Chain.php(63): Magento\Framework\Interception\Chain\Chain->invokeNext('WD\\WarehousingC...', 'dispatch', Object(WD\WarehousingCreditNote\Controller\Adminhtml\WarehousingCreditNote\Edit\Interceptor), Array, 'adminAuthentica...')
#28 /var/www/wd-magento/vendor/magento/module-backend/App/Action/Plugin/Authentication.php(143): Magento\Framework\Interception\Chain\Chain->Magento\Framework\Interception\Chain\{closure}(Object(Magento\Framework\App\Request\Http))
#29 /var/www/wd-magento/vendor/magento/framework/Interception/Chain/Chain.php(67): Magento\Backend\App\Action\Plugin\Authentication->aroundDispatch(Object(WD\WarehousingCreditNote\Controller\Adminhtml\WarehousingCreditNote\Edit\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
#30 /var/www/wd-magento/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\Interception\Chain\Chain->invokeNext('WD\\WarehousingC...', 'dispatch', Object(WD\WarehousingCreditNote\Controller\Adminhtml\WarehousingCreditNote\Edit\Interceptor), Array, 'adminMassaction...')
#31 /var/www/wd-magento/vendor/magento/module-backend/App/Action/Plugin/MassactionKey.php(33): WD\WarehousingCreditNote\Controller\Adminhtml\WarehousingCreditNote\Edit\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Request\Http))
#32 /var/www/wd-magento/vendor/magento/framework/Interception/Interceptor.php(142): Magento\Backend\App\Action\Plugin\MassactionKey->aroundDispatch(Object(WD\WarehousingCreditNote\Controller\Adminhtml\WarehousingCreditNote\Edit\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
#33 /var/www/wd-magento/var/generation/WD/WarehousingCreditNote/Controller/Adminhtml/WarehousingCreditNote/Edit/Interceptor.php(39): WD\WarehousingCreditNote\Controller\Adminhtml\WarehousingCreditNote\Edit\Interceptor->___callPlugins('dispatch', Array, Array)
#34 /var/www/wd-magento/vendor/magento/framework/App/FrontController.php(55): WD\WarehousingCreditNote\Controller\Adminhtml\WarehousingCreditNote\Edit\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))
#35 /var/www/wd-magento/vendor/magento/framework/Interception/Interceptor.php(74): Magento\Framework\App\FrontController->dispatch(Object(Magento\Framework\App\Request\Http))
#36 /var/www/wd-magento/vendor/magento/framework/Interception/Chain/Chain.php(70): Magento\Framework\App\FrontController\Interceptor->___callParent('dispatch', Array)
#37 /var/www/wd-magento/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\\Framewo...', 'dispatch', Object(Magento\Framework\App\FrontController\Interceptor), Array, 'install')
#38 /var/www/wd-magento/vendor/magento/framework/Module/Plugin/DbStatusValidator.php(69): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Request\Http))
#39 /var/www/wd-magento/vendor/magento/framework/Interception/Interceptor.php(142): Magento\Framework\Module\Plugin\DbStatusValidator->aroundDispatch(Object(Magento\Framework\App\FrontController\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
#40 /var/www/wd-magento/var/generation/Magento/Framework/App/FrontController/Interceptor.php(26): Magento\Framework\App\FrontController\Interceptor->___callPlugins('dispatch', Array, Array)
#41 /var/www/wd-magento/vendor/magento/framework/App/Http.php(135): Magento\Framework\App\FrontController\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))
#42 /var/www/wd-magento/vendor/magento/framework/App/Bootstrap.php(258): Magento\Framework\App\Http->launch()
#43 /var/www/wd-magento/pub/index.php(37): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http))
#44 {main}

Exception #1 (ReflectionException): Class WD\WarehousingCreditNote\Block\Adminhtml\Warehousingcreditnote\Edit\Form does not exist
#0 /var/www/wd-magento/vendor/magento/framework/Code/Reader/ClassReader.php(19): ReflectionClass->__construct('WD\\WarehousingC...')
#1 /var/www/wd-magento/vendor/magento/framework/ObjectManager/Definition/Runtime.php(44): Magento\Framework\Code\Reader\ClassReader->getConstructor('WD\\WarehousingC...')
#2 /var/www/wd-magento/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(71): Magento\Framework\ObjectManager\Definition\Runtime->getParameters('WD\\WarehousingC...')
#3 /var/www/wd-magento/vendor/magento/framework/ObjectManager/ObjectManager.php(57): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('WD\\WarehousingC...', Array)
#4 /var/www/wd-magento/vendor/magento/framework/View/Element/BlockFactory.php(45): Magento\Framework\ObjectManager\ObjectManager->create('WD\\WarehousingC...', Array)
#5 /var/www/wd-magento/app/code/Ced/CsMarketplace/Model/View/Element/BlockFactory.php(62): Magento\Framework\View\Element\BlockFactory->createBlock('WD\\WarehousingC...', Array)
#6 /var/www/wd-magento/vendor/magento/framework/View/Layout/Generator/Block.php(257): Ced\CsMarketplace\Model\View\Element\BlockFactory->createBlock('WD\\WarehousingC...', Array)
#7 /var/www/wd-magento/vendor/magento/framework/View/Layout/Generator/Block.php(237): Magento\Framework\View\Layout\Generator\Block->getBlockInstance('WD\\WarehousingC...', Array)
#8 /var/www/wd-magento/vendor/magento/framework/View/Layout.php(760): Magento\Framework\View\Layout\Generator\Block->createBlock('WD\\WarehousingC...', 'warehousing_cre...', Array)
#9 /var/www/wd-magento/vendor/magento/framework/View/Layout.php(743): Magento\Framework\View\Layout->_createBlock('WD\\WarehousingC...', 'warehousing_cre...', Array)
#10 /var/www/wd-magento/var/generation/Magento/Framework/View/Layout/Interceptor.php(349): Magento\Framework\View\Layout->createBlock('WD\\WarehousingC...', 'warehousing_cre...', Array)
#11 /var/www/wd-magento/vendor/magento/framework/View/Element/AbstractBlock.php(381): Magento\Framework\View\Layout\Interceptor->createBlock('WD\\WarehousingC...', 'warehousing_cre...', Array)
#12 /var/www/wd-magento/vendor/magento/module-backend/Block/Widget/Form/Container.php(108): Magento\Framework\View\Element\AbstractBlock->addChild('form', 'WD\\WarehousingC...')
#13 /var/www/wd-magento/app/code/WD/WarehousingCreditNote/Block/Adminhtml/WarehousingCreditNote/Edit.php(110): Magento\Backend\Block\Widget\Form\Container->_prepareLayout()
#14 /var/www/wd-magento/vendor/magento/framework/View/Element/AbstractBlock.php(264): WD\WarehousingCreditNote\Block\Adminhtml\WarehousingCreditNote\Edit->_prepareLayout()
#15 /var/www/wd-magento/vendor/magento/framework/View/Layout/Generator/Block.php(139): Magento\Framework\View\Element\AbstractBlock->setLayout(Object(Magento\Framework\View\Layout\Interceptor))
#16 /var/www/wd-magento/vendor/magento/framework/View/Layout/GeneratorPool.php(86): Magento\Framework\View\Layout\Generator\Block->process(Object(Magento\Framework\View\Layout\Reader\Context), Object(Magento\Framework\View\Layout\Generator\Context))
#17 /var/www/wd-magento/vendor/magento/framework/View/Layout.php(327): Magento\Framework\View\Layout\GeneratorPool->process(Object(Magento\Framework\View\Layout\Reader\Context), Object(Magento\Framework\View\Layout\Generator\Context))
#18 /var/www/wd-magento/var/generation/Magento/Framework/View/Layout/Interceptor.php(89): Magento\Framework\View\Layout->generateElements()
#19 /var/www/wd-magento/vendor/magento/framework/View/Layout/Builder.php(129): Magento\Framework\View\Layout\Interceptor->generateElements()
#20 /var/www/wd-magento/vendor/magento/framework/View/Page/Builder.php(55): Magento\Framework\View\Layout\Builder->generateLayoutBlocks()
#21 /var/www/wd-magento/vendor/magento/framework/View/Layout/Builder.php(65): Magento\Framework\View\Page\Builder->generateLayoutBlocks()
#22 /var/www/wd-magento/vendor/magento/framework/View/Layout.php(244): Magento\Framework\View\Layout\Builder->build()
#23 /var/www/wd-magento/vendor/magento/framework/View/Layout.php(859): Magento\Framework\View\Layout->build()
#24 /var/www/wd-magento/var/generation/Magento/Framework/View/Layout/Interceptor.php(414): Magento\Framework\View\Layout->getBlock('menu')
#25 /var/www/wd-magento/vendor/magento/module-backend/Model/View/Result/Page.php(59): Magento\Framework\View\Layout\Interceptor->getBlock('menu')
#26 /var/www/wd-magento/var/generation/Magento/Backend/Model/View/Result/Page/Interceptor.php(24): Magento\Backend\Model\View\Result\Page->setActiveMenu('WD_WarehousingC...')
#27 /var/www/wd-magento/app/code/WD/WarehousingCreditNote/Controller/Adminhtml/WarehousingCreditNote/Edit.php(56): Magento\Backend\Model\View\Result\Page\Interceptor->setActiveMenu('WD_WarehousingC...')
#28 /var/www/wd-magento/app/code/WD/WarehousingCreditNote/Controller/Adminhtml/WarehousingCreditNote/Edit.php(97): WD\WarehousingCreditNote\Controller\Adminhtml\WarehousingCreditNote\Edit->_initAction()
#29 /var/www/wd-magento/var/generation/WD/WarehousingCreditNote/Controller/Adminhtml/WarehousingCreditNote/Edit/Interceptor.php(24): WD\WarehousingCreditNote\Controller\Adminhtml\WarehousingCreditNote\Edit->execute()
#30 /var/www/wd-magento/vendor/magento/framework/App/Action/Action.php(102): WD\WarehousingCreditNote\Controller\Adminhtml\WarehousingCreditNote\Edit\Interceptor->execute()
#31 /var/www/wd-magento/vendor/magento/module-backend/App/AbstractAction.php(226): Magento\Framework\App\Action\Action->dispatch(Object(Magento\Framework\App\Request\Http))
#32 /var/www/wd-magento/vendor/magento/framework/Interception/Interceptor.php(74): Magento\Backend\App\AbstractAction->dispatch(Object(Magento\Framework\App\Request\Http))
#33 /var/www/wd-magento/vendor/magento/framework/Interception/Chain/Chain.php(70): WD\WarehousingCreditNote\Controller\Adminhtml\WarehousingCreditNote\Edit\Interceptor->___callParent('dispatch', Array)
#34 /var/www/wd-magento/vendor/magento/framework/Interception/Chain/Chain.php(63): Magento\Framework\Interception\Chain\Chain->invokeNext('WD\\WarehousingC...', 'dispatch', Object(WD\WarehousingCreditNote\Controller\Adminhtml\WarehousingCreditNote\Edit\Interceptor), Array, 'adminAuthentica...')
#35 /var/www/wd-magento/vendor/magento/module-backend/App/Action/Plugin/Authentication.php(143): Magento\Framework\Interception\Chain\Chain->Magento\Framework\Interception\Chain\{closure}(Object(Magento\Framework\App\Request\Http))
#36 /var/www/wd-magento/vendor/magento/framework/Interception/Chain/Chain.php(67): Magento\Backend\App\Action\Plugin\Authentication->aroundDispatch(Object(WD\WarehousingCreditNote\Controller\Adminhtml\WarehousingCreditNote\Edit\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
#37 /var/www/wd-magento/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\Interception\Chain\Chain->invokeNext('WD\\WarehousingC...', 'dispatch', Object(WD\WarehousingCreditNote\Controller\Adminhtml\WarehousingCreditNote\Edit\Interceptor), Array, 'adminMassaction...')
#38 /var/www/wd-magento/vendor/magento/module-backend/App/Action/Plugin/MassactionKey.php(33): WD\WarehousingCreditNote\Controller\Adminhtml\WarehousingCreditNote\Edit\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Request\Http))
#39 /var/www/wd-magento/vendor/magento/framework/Interception/Interceptor.php(142): Magento\Backend\App\Action\Plugin\MassactionKey->aroundDispatch(Object(WD\WarehousingCreditNote\Controller\Adminhtml\WarehousingCreditNote\Edit\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
#40 /var/www/wd-magento/var/generation/WD/WarehousingCreditNote/Controller/Adminhtml/WarehousingCreditNote/Edit/Interceptor.php(39): WD\WarehousingCreditNote\Controller\Adminhtml\WarehousingCreditNote\Edit\Interceptor->___callPlugins('dispatch', Array, Array)
#41 /var/www/wd-magento/vendor/magento/framework/App/FrontController.php(55): WD\WarehousingCreditNote\Controller\Adminhtml\WarehousingCreditNote\Edit\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))
#42 /var/www/wd-magento/vendor/magento/framework/Interception/Interceptor.php(74): Magento\Framework\App\FrontController->dispatch(Object(Magento\Framework\App\Request\Http))
#43 /var/www/wd-magento/vendor/magento/framework/Interception/Chain/Chain.php(70): Magento\Framework\App\FrontController\Interceptor->___callParent('dispatch', Array)
#44 /var/www/wd-magento/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\\Framewo...', 'dispatch', Object(Magento\Framework\App\FrontController\Interceptor), Array, 'install')
#45 /var/www/wd-magento/vendor/magento/framework/Module/Plugin/DbStatusValidator.php(69): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Request\Http))
#46 /var/www/wd-magento/vendor/magento/framework/Interception/Interceptor.php(142): Magento\Framework\Module\Plugin\DbStatusValidator->aroundDispatch(Object(Magento\Framework\App\FrontController\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
#47 /var/www/wd-magento/var/generation/Magento/Framework/App/FrontController/Interceptor.php(26): Magento\Framework\App\FrontController\Interceptor->___callPlugins('dispatch', Array, Array)
#48 /var/www/wd-magento/vendor/magento/framework/App/Http.php(135): Magento\Framework\App\FrontController\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))
#49 /var/www/wd-magento/vendor/magento/framework/App/Bootstrap.php(258): Magento\Framework\App\Http->launch()
#50 /var/www/wd-magento/pub/index.php(37): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http))
#51 {main}

i know that the cause is WD\WarehousingCreditNote\Block\Adminhtml\Warehousingcreditnote\Edit\Form should be WD\WarehousingCreditNote\Block\Adminhtml\WarehousingCreditNote\Edit\Form

but i don't know where to fix that, the namespace of the class itself already correct.

i've already tried to run php bin/magento setup:upgrade && php bin/magento setup:di:compile

rm -rf var/generation var/cache var/page_cache var/di

php bin/magento c:c php bin/magento c:f

but still no luck

any idea?

1 Answer 1

1

Go to /var/www/wd-magento/app/code/WD/WarehousingCreditNote/Block/Adminhtml/Warehousingcreditnote and rename the folder. You may need to rename it to WarehousingCreditNote1 and then rename it again to WarehousingCreditNote (since some servers are case insensitive).

Also, open /var/www/wd-magento/app/code/WD/WarehousingCreditNote/Block/Adminhtml/Warehousingcreditnote/Form.php and check the namespace case

You should also do a search for 'Block/Adminhtml/Warehousingcreditnote' to make sure you are using the correct case in all places

5
  • i have tried your suggestions just now, and still no luck :(
    – lazycoder
    Jun 29, 2022 at 3:37
  • Did you rerun php bin/magento setup:upgrade && php bin/magento setup:di:compile? Jun 29, 2022 at 3:43
  • yes i did, but still got the same error after i rename it to the original one
    – lazycoder
    Jun 29, 2022 at 3:51
  • Are you sure the file is renamed and you update the namespace? Jun 29, 2022 at 3:53
  • somehow, your suggestions work like a charm....thank you....
    – lazycoder
    Jun 29, 2022 at 4:29

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.