WAIT: Code from widget code block don't work

Bricks Version: 1.4.0
Browser: Chrome 90
OS: Windows
URL: https://larsunrisa.com

I create a popup and set all buttons on website, like in this tutorial: How to create a Popup/Modal in Wordpress / Bricks Builder without any Plugin - YouTube
I try another tutorial

code doesn’t execute in Bricks 1.4.0, because if I install bricks 1.3.7 all works

1 Like

you can see me backend

popup dispere

but in frontend (without click on button)

The error on your site (“Uncaught SyntaxError: Unexpected token ‘<’”) is because of some improper characters in your code block:

However, the fact that the same code worked in 1.3.7 matches a similar situation that I had, where code that worked perfectly in 1.3.7 no longer worked in 1.4.0. I think that the contents of the code block gets changed somehow during the upgrade.

ok I shot a screencast with another code from a tutorial (I demonstrate how works in 1.3.7 and after instal 1.4.0 and …) bug code block - YouTube

I use code from this tutorial: Build a Popup With JavaScript - YouTube

you can see how bricks 1.4.0 change code

So this really is the exact same problem I had a couple days ago. The same code that worked fine in v.1.3.7 does not work in v.1.4.0 @timmse implied there was no problem with Bricks.

I tried my best to tell him that’s not true. Good to see further evidence that I’m not crazy.

Hm, interested. I am curious if Bricks runs code trough some filters or why does this happen.

I try install script organizer, and what do you think? My code works

problem with syntax disappear (if i use script organizer)

Hi Mihail,
Thanks a lot for your report and the detailed information. We’re currently investigating what causes the changes when using the code element.

I simply said that I cannot reproduce the webfont.js error.

To be able to recognize and acknowledge an error, we must be able to reproduce it. And that was unfortunately not possible in your case until now, but Mihails Screenshot showing there’s a difference between code block and code on frontend helps a lot.

Best regards,
timmse

1 Like

I am preparing a few more screencasts with errors that work in 1.3.7 and break if everything is done the same way in 1.4.0 (without custom code)

With pleasure,
but please check first whether the problem has already been reported and please create a separate thread for each problem - ideally with simple instructions on how we can reproduce it.

:fist:

yep, soon I will find 5 minutes to check if anyone else has such a problem and then record each video with a demonstration of how it worked / how it works now and how I fixed the problem

Hello @ainom, @davidovmihail, @matejmohar

We found out a possible conflict between the Dynamic Data logic and the scripts inside the Code element or inserted directly into the page content. We’ll provide a fix if not before, at least with the 1.4 stable release.

Thank you.

4 Likes

Is there any update on this issue?

Even a simple <p> tag doesn’t work in my custom code. I’ve enabled/disabled every setting and tried many ways to get around it with no luck.

Hi Edan,
I am relatively sure that the problem reported here was solved in Bricks 1.5, however it was not marked as solved.

Therefore:

What exactly is your problem?
And what do I have to do to be able to reproduce it?

Can you show me and explain the problem in a short screencast?

The code is simply not being executed. I’ve enabled and disabled anything that could be related.

It renders as plain text on the front side just as it comes up in the builder.

Including the code execution in Bricks Settings » Builder Access (1) + the code execution on the code element (2) itself? If so, are there any console errors?

1 Like