Comments (16)
After a wild ride in the Prestashop/Symfony core I finally found a solution to make the demodoctrine module work :
- Open
demodoctrine/config/routes.yml
and look for :_legacy_link: 'AdminDemodoctrineQuote:update'
on line 40 - Change
AdminDemodoctrineQuote:update
toAdminDemodoctrineQuote:edit
- Voilà ! 🚀
from example-modules.
In case someone has this issue, it's a cookie trouble. Clear all cookies and data from domain fixe it.
from example-modules.
Same issue here. I'm also trying to create my own module using demodoctrine as a model, and I get the same error.
This is the stack trace for my module:
Symfony\Component\Debug\Exception\ClassNotFoundException:
Attempted to load class "LegacyLayout" from the global namespace.
Did you forget a "use" statement?
at classes\controller\AdminController.php:3674
at AdminControllerCore->validateRules()
(classes\controller\AdminController.php:1170)
at AdminControllerCore->processAdd()
(classes\controller\AdminController.php:981)
at AdminControllerCore->postProcess()
(classes\controller\Controller.php:295)
at ControllerCore->run()
(src\Adapter\LegacyContext.php:240)
at PrestaShop\PrestaShop\Adapter\LegacyContext->getLegacyLayout('AdminRetailersmapGroups', '', array(), '', true, '', false, '', array('base_url' => '/admin374taf1hz/index.php', 'token' => 'VuUyVsBOLcbKq24QzAOGJ-5WPXDvL_b8Z71AZHppIus'), '', true)
(src\PrestaShopBundle\Twig\LayoutExtension.php:206)
at PrestaShopBundle\Twig\LayoutExtension->getLegacyLayout('AdminRetailersmapGroups', '', array(), '', true, '', false, '', array('base_url' => '/admin374taf1hz/index.php', 'token' => 'VuUyVsBOLcbKq24QzAOGJ-5WPXDvL_b8Z71AZHppIus'), '', true)
(var\cache\dev\twig\81\81a1b52507b41cc8f61a6ee6825db41672b392967f63ec166704882f4e14b78a.php:42)
at __TwigTemplate_5a423c1fb1b3c4a4739402c229f3c453599208bfd88ee3ff538b876b259849ff->doGetParent(array('groupForm' => object(FormView), 'theme' => object(Theme), 'default_currency' => '€', 'root_url' => '/', 'js_translatable' => array(), 'app' => object(AppVariable), 'webpack_server' => false, 'ps' => object(__TwigTemplate_11fa9b76aef4cbb57f844945f48d9295b55e0854c6e849f1360cf2714778f898)))
(vendor\twig\twig\src\Template.php:127)
at Twig\Template->getParent(array('groupForm' => object(FormView), 'theme' => object(Theme), 'default_currency' => '€', 'root_url' => '/', 'js_translatable' => array(), 'app' => object(AppVariable), 'webpack_server' => false, 'ps' => object(__TwigTemplate_11fa9b76aef4cbb57f844945f48d9295b55e0854c6e849f1360cf2714778f898)))
(var\cache\dev\twig\81\81a1b52507b41cc8f61a6ee6825db41672b392967f63ec166704882f4e14b78a.php:56)
at __TwigTemplate_5a423c1fb1b3c4a4739402c229f3c453599208bfd88ee3ff538b876b259849ff->doDisplay(array('groupForm' => object(FormView), 'theme' => object(Theme), 'default_currency' => '€', 'root_url' => '/', 'js_translatable' => array(), 'app' => object(AppVariable), 'webpack_server' => false, 'ps' => object(__TwigTemplate_11fa9b76aef4cbb57f844945f48d9295b55e0854c6e849f1360cf2714778f898)), array('javascripts' => array(object(__TwigTemplate_5a423c1fb1b3c4a4739402c229f3c453599208bfd88ee3ff538b876b259849ff), 'block_javascripts'), 'translate_javascripts' => array(object(__TwigTemplate_5a423c1fb1b3c4a4739402c229f3c453599208bfd88ee3ff538b876b259849ff), 'block_translate_javascripts'), 'content_header' => array(object(__TwigTemplate_5a423c1fb1b3c4a4739402c229f3c453599208bfd88ee3ff538b876b259849ff), 'block_content_header'), 'sidebar_right' => array(object(__TwigTemplate_5a423c1fb1b3c4a4739402c229f3c453599208bfd88ee3ff538b876b259849ff), 'block_sidebar_right'), 'content' => array(object(__TwigTemplate_03a1b76a50d403e612871e8098c1359e46f6cf8ba1d8088b30c81812139f4940), 'block_content')))
(vendor\twig\twig\src\Template.php:455)
at Twig\Template->displayWithErrorHandling(array('groupForm' => object(FormView), 'theme' => object(Theme), 'default_currency' => '€', 'root_url' => '/', 'js_translatable' => array(), 'app' => object(AppVariable), 'webpack_server' => false), array('javascripts' => array(object(__TwigTemplate_5a423c1fb1b3c4a4739402c229f3c453599208bfd88ee3ff538b876b259849ff), 'block_javascripts'), 'translate_javascripts' => array(object(__TwigTemplate_5a423c1fb1b3c4a4739402c229f3c453599208bfd88ee3ff538b876b259849ff), 'block_translate_javascripts'), 'content_header' => array(object(__TwigTemplate_5a423c1fb1b3c4a4739402c229f3c453599208bfd88ee3ff538b876b259849ff), 'block_content_header'), 'sidebar_right' => array(object(__TwigTemplate_5a423c1fb1b3c4a4739402c229f3c453599208bfd88ee3ff538b876b259849ff), 'block_sidebar_right'), 'content' => array(object(__TwigTemplate_03a1b76a50d403e612871e8098c1359e46f6cf8ba1d8088b30c81812139f4940), 'block_content')))
(vendor\twig\twig\src\Template.php:422)
at Twig\Template->display(array('groupForm' => object(FormView), 'theme' => object(Theme), 'default_currency' => '€', 'root_url' => '/', 'js_translatable' => array(), 'app' => object(AppVariable), 'webpack_server' => false), array('content' => array(object(__TwigTemplate_03a1b76a50d403e612871e8098c1359e46f6cf8ba1d8088b30c81812139f4940), 'block_content')))
(var\cache\dev\twig\59\596d10e3ee60edd293471b687e926362a9e18fab9d6f747447a6fee71545f51b.php:41)
at __TwigTemplate_03a1b76a50d403e612871e8098c1359e46f6cf8ba1d8088b30c81812139f4940->doDisplay(array('groupForm' => object(FormView), 'theme' => object(Theme), 'default_currency' => '€', 'root_url' => '/', 'js_translatable' => array(), 'app' => object(AppVariable), 'webpack_server' => false), array('content' => array(object(__TwigTemplate_03a1b76a50d403e612871e8098c1359e46f6cf8ba1d8088b30c81812139f4940), 'block_content')))
(vendor\twig\twig\src\Template.php:455)
at Twig\Template->displayWithErrorHandling(array('groupForm' => object(FormView), 'theme' => object(Theme), 'default_currency' => '€', 'root_url' => '/', 'js_translatable' => array(), 'app' => object(AppVariable), 'webpack_server' => false), array('content' => array(object(__TwigTemplate_03a1b76a50d403e612871e8098c1359e46f6cf8ba1d8088b30c81812139f4940), 'block_content')))
(vendor\twig\twig\src\Template.php:422)
at Twig\Template->display(array('groupForm' => object(FormView)))
(vendor\twig\twig\src\Template.php:434)
at Twig\Template->render(array('groupForm' => object(FormView)))
(vendor\symfony\symfony\src\Symfony\Bridge\Twig\TwigEngine.php:50)
at Symfony\Bridge\Twig\TwigEngine->render('@Modules/retailersmap/views/templates/admin/create.html.twig', array('groupForm' => object(FormView)))
(vendor\symfony\symfony\src\Symfony\Bundle\FrameworkBundle\Controller\ControllerTrait.php:286)
at Symfony\Bundle\FrameworkBundle\Controller\Controller->render('@Modules/retailersmap/views/templates/admin/create.html.twig', array('groupForm' => object(FormView)))
(modules\retailersmap\src\Controller\RetailersMapAdminGroupsController.php:64)
at PrestaShop\Module\RetailersMap\Controller\RetailersMapAdminGroupsController->createAction(object(Request))
(vendor\symfony\symfony\src\Symfony\Component\HttpKernel\HttpKernel.php:151)
at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), 1)
(vendor\symfony\symfony\src\Symfony\Component\HttpKernel\HttpKernel.php:68)
at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), 1, false)
(vendor\symfony\symfony\src\Symfony\Component\HttpKernel\Kernel.php:200)
at Symfony\Component\HttpKernel\Kernel->handle(object(Request), 1, false)
(admin374taf1hz\index.php:82)
from example-modules.
I have same problem and error. I have clean new install Prestashop 1.7.7.1 on php 7.3.27. I try to correct entity tablang, but without success (Fix tab entity tabLangs variable mapping #21218)
from example-modules.
Hi @dvyvoj @dlabarta and @darioscattolini I'm sorry but I just tried, and demodoctrine works well for me.
If you can send a ZIP of your module I could try to see what is the issue, but for me it works good
What I do
- Install demodoctrine module following README instructions
- Go on BO, open Modules page, click "configure"
- Add quotes, see them, then generate quotes
- Go on FO homepage to see quotes displaued
from example-modules.
I have mysql 8. Installation also failed, i need corect sql script - add semicolon at end of statement. After this, install ok. Can be problem in mysql version?
from example-modules.
Hello,
I've Same problem when I tried to add quotes (in demodoctrine module)
Version 1.7.7.4
I think It's rather system problem than developper problem
Is anyone find solution please or please help me to understand where come from the problem ?
probably my dev environment ?
Prestashop 1.7.7.4 /mysql with docker
Ubuntu 20.04 from WSL2 with php-7.3
EDIT
there is a probably problem when I installed Symfony 3.4 ( Which I understood the version needed ) , the command line isn't available
I rather ask help in another place, this is not a problem with this demo module
EDIT 2
I install a linux dev environment , ubuntu/docker ...
I make a mistake somewhere, sure ... same problem appears on demodoctrine module
@matks could you give me some informations about your Dev environnment please ? to compare what I do bad ?
Thanks
Regards
from example-modules.
@dlabarta , @darioscattolini , do you solve your problem please ?
from example-modules.
Same problem here, on Windows, clean PrestaShop 1.7.7.4 installation.
from example-modules.
Same problem on Mac :) , with mamp ( test on 1.7.7.4, 1.7.7.1, 1.7.7.0 )
php7.3, Mysql 5.7
I don't understand ...
please help ?
regards
from example-modules.
Next step ...
I think I found a bot of solution when I Generate Quotes ( part of module which run directly )
There is a diderot's quote which says :
"On n'est point toujours une bête pour l'avoir été quelquefois...."
Ce fut une révélation ...
Bref...
In routes.yml , some routes add a default : _legacy_controller AdminDemodoctrineQuote which not exists so probably LegacyLaout class Cry when she not founds legacy controller ...
when commenting this lines (for quote_create road) , it runs ...
I don't know for the moment why quote_index road runs directly (like delete) enough commenting legacy_controller road ...
from example-modules.
I have mysql 8. Installation also failed, i need corect sql script - add semicolon at end of statement. After this, install ok. Can be problem in mysql version?
I dont think the install and this error are related :/
from example-modules.
I got the same problem ...
`
ClassNotFoundException
Symfony\Component\Debug\Exception\ClassNotFoundException: Attempted to load class "LegacyLayout" from the global namespace. Did you forget a "use" statement? at classes/ObjectModel.php:2036 at ObjectModelCore::getDefinition('LegacyLayout') (classes/controller/AdminController.php:868) at AdminControllerCore->processFilter() (classes/controller/AdminController.php:968) at AdminControllerCore->postProcess() (classes/controller/Controller.php:295) at ControllerCore->run() (src/Adapter/LegacyContext.php:242) at PrestaShop\PrestaShop\Adapter\LegacyContext->getLegacyLayout('AdminPerformance', 'Performances', array('clear_cache' => array('href' => '/serverarianeplast/admin198uhbdmj/index.php/configure/advanced/performance/clear-cache?_token=UhpEIgPFKIyuXTgM9kgtNcPi6KgFGzd_xu27GmPKhrQ', 'desc' => 'Vider le cache', 'icon' => 'delete')), '', true, '', true,
`
I don't know how to resolve it. This error appears when I want to go to the module page
from example-modules.
Hello,
I'm facing the same issue and I've fixed that one by changing the PHP version on my webserver.
The issue was resolved by using an "older" PHP version (7.3 instead of 7.4) but before this I have disabled all the plugins from the database by porting the "active" field all to zero.
Hope this helps.
from example-modules.
Hello,
I have the same problem. I created an admin module. After I make a search, causing cookies to be changed, the standard products list page does not work anymore.
Please help!
from example-modules.
Thanks for the tips @kvnbra & @ComonSoft ! I'm closing this ticket :)
from example-modules.
Related Issues (20)
- Make example modules works with Prestashop 8.0 HOT 8
- FormattedTextareaType should use TranslateType
- The demoproductform module does not work in 8.0.0 HOT 3
- Use window.prestashop object instead for JS component HOT 1
- demosymfonyform HOT 1
- Webpack build issues HOT 2
- Fatal error with module demoextendtemplates HOT 5
- Test with PrestaShop 8.1
- More Symfony services examples
- example_module_mailtheme needs to work with PrestaShop 8
- Module demoproductform and Prestashop 8.1.0 HOT 6
- Module tabs HOT 2
- Override AdminController.php and AdminOrdersController.php HOT 5
- [Demo Doctrine module] Demo doctrine module crashes when using 2 languages in BO and a new quote is created but one language field is not filled in. HOT 1
- [Demo Multistore module] Multistore module v1.1 scope
- npm error while building in module HOT 4
- add a screenshot for each examples
- DemoExtendGrid module does not work HOT 3
- Undefined class constant 'MIN_MAX'
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from example-modules.