ultimate-blocks icon indicating copy to clipboard operation
ultimate-blocks copied to clipboard

Content Toggle Error

Open dink opened this issue 3 years ago • 3 comments

I need to add various customization to some of the blocks, so I'm compiling the blocks myself. Without any initial changes, when I compiled it on first run it went all smooth and no errors. However, the "Content Toggle" blocks is producing an error in the editor with the following message: This block has encountered an error and cannot be previewed.

In the console it says: TypeError: panels[0] is undefined render editorDisplay.js:539

I'm not sure how to fix this one. Any ideas?

All the other blocks seem to be working fine otherwise.

Cheers

dink avatar Sep 16 '21 02:09 dink

Hi @dink! Thanks for letting us know. We just pushed a fix for the issue you noticed. If in case it still doesn't work, just make sure that the value would be set to true if the panels variable is undefined.

Alexius08 avatar Sep 16 '21 03:09 Alexius08

@Alexius08 Thank you for the quick response. Unfortunately it didn't work, I'm still getting the same error, and the console error now says:

TypeError: panels[0] is undefined render editorDisplay.js:540 The only change that was made was made was this, correct? https://github.com/Ultimate-Blocks/Ultimate-Blocks/commit/59c37a0a1970251f8d38960f01d73b86d6795eec

If in case it still doesn't work, just make sure that the value would be set to true if the panels variable is undefined.

I'm not sure what you mean by that. Where would I set this? Sorry, there's a lot of code in there I still haven't explored.

dink avatar Sep 16 '21 04:09 dink

Hi @dink! The highlighted line contains the line where the error comes from. Not so sure what value comes up from panels on your end and how it evaded the check I added. Perhaps you can add console.log(panels); to somewhere just before the return statement in PanelContent's render method and see what comes up. Then, based on what comes up on your end, we could tweak the existing fix.

Alexius08 avatar Sep 16 '21 17:09 Alexius08

Issue is solved with later updates.

erdembircan avatar Oct 26 '23 08:10 erdembircan