Git Product home page Git Product logo

Comments (16)

kvnbra avatar kvnbra commented on August 21, 2024 1

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 to AdminDemodoctrineQuote:edit
  • Voilà ! 🚀

from example-modules.

ComonSoft avatar ComonSoft commented on August 21, 2024 1

In case someone has this issue, it's a cookie trouble. Clear all cookies and data from domain fixe it.

from example-modules.

darioscattolini avatar darioscattolini commented on August 21, 2024

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.

dvyvoj avatar dvyvoj commented on August 21, 2024

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.

matks avatar matks commented on August 21, 2024

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

  1. Install demodoctrine module following README instructions
  2. Go on BO, open Modules page, click "configure"
  3. Add quotes, see them, then generate quotes
  4. Go on FO homepage to see quotes displaued

from example-modules.

dvyvoj avatar dvyvoj commented on August 21, 2024

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.

NicolasG25 avatar NicolasG25 commented on August 21, 2024

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.

NicolasG25 avatar NicolasG25 commented on August 21, 2024

@dlabarta , @darioscattolini , do you solve your problem please ?

from example-modules.

adrianogoncalves avatar adrianogoncalves commented on August 21, 2024

Same problem here, on Windows, clean PrestaShop 1.7.7.4 installation.

from example-modules.

NicolasG25 avatar NicolasG25 commented on August 21, 2024

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.

NicolasG25 avatar NicolasG25 commented on August 21, 2024

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.

matks avatar matks commented on August 21, 2024

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.

william-dandrea avatar william-dandrea commented on August 21, 2024

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.

UffTec avatar UffTec commented on August 21, 2024

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.

sonnessa avatar sonnessa commented on August 21, 2024

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.

kpodemski avatar kpodemski commented on August 21, 2024

Thanks for the tips @kvnbra & @ComonSoft ! I'm closing this ticket :)

from example-modules.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.