Home / Prestashop Module Tutorials / Ap Page Builder / Error Address token not defined when create or edit widget | Ap Pagebuilder Module
error-address-token-not-defined-when-create-and-edit-widget
error-address-token-not-defined-when-create-and-edit-widget

Error Address token not defined when create or edit widget | Ap Pagebuilder Module

 

Ap Page builder – a powerful module with strong features in back-office that allow you to manage, customize, edit your website quickly.  One of the outstanding functions of this Prestashop Module is to make it possible for you to create and edit widgets in Ap Hook Builder.

 

1. Edit Widget in Ap Hook Builder

You can easily edit HTML right on a popup with available handy options.

 

Edit HTML
Edit HTML

2. Error when create and edit widget

However, sometimes, when you create and edit the widget, the popup doesn’t display the right options for you to edit. You can realize this error displayed at all widgets that have edit part as the picture below

 

Error in Edit HTML
Error in Edit HTML

 

When facing this problem, do not panic.

what you need to do first is to press F12 then select Console, you will see the error report:

Uncaught ReferenceError: address_token is not defined in file admin.js?v=1.7.6.2

 

Error address token not defined
Error address token not defined

 

Now I will guide you on how to deal with it.

Firstly, you access the file via Ftp YOUR_SITE/modules/appagebuilder/views/js/admin/home.js

then find code inline 574

$('#modal_form .modal-body').html(data);

 

replace to 

//fix bug prestashop 1.7.6.2 can not get address_token

  if (typeof address_token === "undefined") {
var match = RegExp('[?&]' + 'token' + '=([^&]*)').exec(window.location.search);
address_token = match && decodeURIComponent(match[1].replace(/\+/g, ' '));
}
$('#modal_form .modal-body').html(data);

 

or you can download in this URL and replace
https://drive.google.com/file/d/1YHw7b2C4OHRoplzVZobMhttbnnJ4pGgF/view?usp=sharing

 

Now everything is back to work. You can continue to create and edit the widget.

Good luck with Ap Page Builder Module.

 

About Luu Ly

Check Also

Leotheme Black Friday 2022

Prestashop Theme and Module Black Friday and Cyber Monday Sales Leotheme 2022 30% Off

Prestashop Leotheme Black Friday 2022 Promotion! Dear valued customers, Black Friday and Cyber Monday Sales …

4 comments

  1. Hello,

    It doesn’t work for me, I installed the file in the right place but I still have the “token” error and cannot modify the description of the image. What should I do ?

    Thank you so much

    Dino

  2. Hello,

    I apologize for my very bad English.

    I bought a “Leo Clarck” template for Prestashop and I have a problem. The Apollo page Builder module does not work. Indeed.
    I cannot modify elements which I put in the positions, that makes me jump the editors and oblige me after each modifications to save quit then return to be able to modify again.
    I noticed with the console that I had this concern: ReferenceError: address_token is not defined

    Please tell me how to solve my problem.

    I use Prestashop 1.7.6.x

Leave a Reply