Jump to content

Megamenu module not works give error 404


rb10

Recommended Posts

Hi stay using MEgaMenu module, when i add a new item give 404 error, i have also active debug mode but not have any error message, in server i found this : 
 

 

[Tue Sep 02 09:21:51.605403 2025] [lsapi:error] [pid 3757329:tid 3757350] [client 95.246.177.35:64108] [host www.site.com] Backend fatal error: PHP Fatal error:  Uncaught ErrorException: Warning: Undefined property: Symfony\\Component\\VarDumper\\Caster\\CutStub::$cache_locking in public_html/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php:737\nStack trace:\n#0 [internal function]: Smarty_Internal_Template->__destruct()\n#1 {main}\n  thrown in public_html/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php on line 737\n, referer: https://www.site.com/admin/index.php?controller=AdminModules&token=b9bcd264dc644f9c12f16936a9e9d40b&configure=posmegamenu&id_posmegamenu_item=2&editMenu=1


 

 

thanks to all

Link to comment
Share on other sites

What the error says

  • CutStub is a class from Symfony VarDumper (a debugging tool), not something that Smarty normally deals with.
  • When you have debug mode enabled, Symfony replaces objects with special “stubs” so that they can be easily displayed.
  • Smarty tries to access the $cache_locking property in the destructor (i.e., when clearing memory), which does not exist in CutStub.
  • As a result, you get a Fatal Error when adding/editing items in MegaMenu.

 

Why is this happening?

This is a compatibility issue between the Smarty version and Symfony VarDumper.

In Prestashop (1.7 or 8), this is a fairly well-known bug: when debug mode is enabled, some modules in the admin panel crash.

 

How to fix it

1. The easiest way is to disable debug mode

In the config/defines.inc.php file, change:

define('_PS_MODE_DEV_', false);

 

2. Update Smarty and VarDumper

Ensure you have compatible versions:

  • Prestashop 1.7.8+ → Smarty 3.1.43 and Symfony 4.4
  • Prestashop 8 → Smarty 4.x and Symfony 5.x

If you can use Composer:

composer update smarty/smarty symfony/var-dumper

 

3. A small correction in the Smarty file

Open:

  • vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php (line approx. 737).

Add security, e.g.:

if (isset($this->cache_locking)) {
    // original logic
}

 

4. Working in the farmyard

If you just want to add new menu items → disable debugging for a moment, add them, and then enable it again.

 

 

Let us know if you managed to solve the problem. You can also consider updating the menu module itself... or contacting mega menu support (they are quite helpful).

Link to comment
Share on other sites

41 minutes ago, cocos.codes said:

Cosa dice l'errore

  • CutStub è una classe di Symfony VarDumper (uno strumento di debug), non qualcosa di cui Smarty si occupa normalmente.
  • Quando la modalità debug è abilitata, Symfony sostituisce gli oggetti con speciali "stub" in modo che possano essere facilmente visualizzati.
  • Smarty tenta di accedere alla proprietà $cache_locking nel distruttore (ad esempio, quando si cancella la memoria), che non esiste in CutStub.
  • Di conseguenza, si verifica un errore fatale quando si aggiungono/modificano elementi in MegaMenu.

 

Perché sta succedendo questo?

Si tratta di un problema di compatibilità tra la versione Smarty e Symfony VarDumper.

In Prestashop (1.7 o 8), questo è un bug abbastanza noto: quando la modalità debug è abilitata, alcuni moduli nel pannello di amministrazione si bloccano.

 

Come risolverlo

1. Il modo più semplice è disabilitare la modalità debug

Nel file config/defines.inc.php, modificare:

 

 

2. Aggiorna Smarty e VarDumper

Assicurati di avere versioni compatibili:

  • Prestashop 1.7.8+ → Smarty 3.1.43 e Symfony 4.4
  • Prestashop 8 → Smarty 4.x e Symfony 5.x

Se puoi usare Composer:

 

3. Una piccola correzione nel file Smarty

Aprire:

  • vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php (riga circa 737).

Aggiungere sicurezza, ad esempio:

  
    

 

4. Lavorare nel cortile della fattoria

Se vuoi semplicemente aggiungere nuove voci di menu → disattiva il debug per un momento, aggiungile e poi riattivalo.

 

 

Facci sapere se sei riuscito a risolvere il problema. Puoi anche valutare di aggiornare il modulo del menu stesso... o contattare l'assistenza Mega Menu (sono molto disponibili).

Thanks, i tried but still not works

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...