Enonic version: Enonic 7.1.1
Hello, I made a listener for when there is a save event to set a hidden variable inside .data of my content. It set the variable there and at first with no errors, but, when I try to add a new HTMLArea it then generates a TextArea instead and any value added there will be treated as null if I try to save again.
I get the follow error on the console:
It doesn’t generate a TextArea. If it looks like it does on your screenshot it means that something in your code prevents correct initialisation of a new instance of HTMLArea, that’s why it looks different from the other two.
Please share your code and we’ll try to figure out what happens.
It happened after I added this code, not sure what else could’ve caused it.
Let’s start with sequence of actions. On your screenshot the top two occurrences of HTMLArea are correct and the 3rd one is corrupt. Is it so that you can add as many correct ones as you wish before save, and only after save it breaks and starts adding corrupt occurrences?
Another question - if you turn off your event listener, does it start working as it should?
Yes for both, the corrupted one only happens after a save, I need to reopen the content in order to fix it, and if there isn’t a listener then it works fine. It breaks using either content or node libs.
Did you get this figured out? I reproduced your setup locally - one content with checkbox and x-data with multi HTML areas - and it works fine for me, based on the number of HTML areas in draft/master your listener would set the checkbox on or off. After save new areas also get added without any problems.
Not yet. I’ve created an empty sandbox, a small test app and it worked fine. So far all I can tell is that there is something else in our environment that causes this behavior since the same test app (only the x-data with htmlarea) breaks there too.
I’ve changed the tag to HELP since chances are that the problem is caused by something else in our app.