How do I diagnose Webform Conditionals failing?
Webform conditionals on a particularly large webform have stopped working, failing silently, so that the standard "if this is not empty then this is shown" type rules do nothing.
How do I diagnose Webform Conditionals failing?
Webform conditionals on a particularly large webform have stopped working, failing silently, so that the standard "if this is not empty then this is shown" type rules do nothing.
So the issue is what I have done here:
https://forum.backdropcms.org/forum/webform-references-tree
in that by loading extra JS into $form['#attached']['js'], the Backdrop.webform.conditionalCheck fails silently, not even a console.log.
Verified by turning off that loading for that form. Also verified by sending useless JS to the form. Bug in Webform's JS handling?
I have confirmed, that using the method $form['#attached']['js'] stops the webform.js from loading.
https://docs.backdropcms.org/form_api#attached shows that this is the expected method of JS loading.
Issue opened at Github: https://github.com/backdrop-contrib/webform/issues/220
d'oh. Because of course it is reassigning. Don't mind me...
the correct syntax is
$form['#attached']['js'][] = backdrop_get_path('module', 'mymodule') . '/mymodule.js';
This was from examining line 2463- of the webform.module, where
// Attach necessary JavaScript and CSS. $form['#attached'] = array( 'css' => array(backdrop_get_path('module', 'webform') . '/css/webform.css'), 'js' => array(backdrop_get_path('module', 'webform') . '/js/webform.js'), );
Showing that I needed to add array to that.
d'oh. Because of course it is reassigning. Don't mind me...
the correct syntax is