Closed john-hix closed 3 years ago
Found here. Running document.getElementById("options-html")
in the console doesn't bring any element up, neither when editing the two-column block nor when in the main block selection screen.
Details of the diagnosis, with documentation of how the Newsletter Plugin blocks work, for reference.
The Newsletter Plugin creates inputs with ids like options-{your-value}
in response to calls to $controls->text('your-value')
(examples here, here).
I noticed that the salutation-text
block doesn't give an error, and it also has the code looking for #options-html
. That's because line 49 of the salutation-text
options.php
file creates a input with the id options-html
.
Because the two-column block's options.php
file creates no input for 'html', the code at line 24 (as above) does not find any element, so it throws an error from the CodeMirror library when it tries to use the null value returned from document.getElementById()
.
@Ebcosio , is there need for the CodeMirror editor in the two-column-event
block? I saw you used it for some standard HTML markup for the salutation block. It seems like the presence of the JS code (causing the error) in the two-column block is a copy-paste error, and so it can be deleted. Correct me if I'm wrong.
Thanks
Error when adding two-column event newsletter block to a template: