Sage 10 and Gravity Forms, Marge Tag Dropdown not showing up

I have the issue that whenever I use a Sage based theme and Gravity Forms, that the merge tag dropdown of Gravity forms e.g. for editing Notifications, does not show up.

The Inspectors shows the following JS error:

[Error] Unhandled Promise Rejection: TypeError: null is not an object (evaluating 'document.getElementById( 'event' ).value')
	MaybeAddSaveLinkMergeTag (admin.php:504)

which corresponds to the following JS in the admin.php:


<form id="gform-settings" class="gform_settings_form" data-js="page-loader" action="" method="post" enctype="multipart/form-data" novalidate>
<script type="text/javascript">
gform.addFilter('gform_merge_tags', 'MaybeAddSaveLinkMergeTag');
function MaybeAddSaveLinkMergeTag(mergeTags, elementId, hideAllFields, excludeFieldTypes, isPrepop, option) {
//this line throws the error, as apparently at the time there is no element 
//with the id of event in the dom
var event = document.getElementById('event').value;

If I deactivate all Plugins except for Gravity Forms and have the sage theme active this happens. When I Choose a standard theme, does does not happen.

I am assuming this has to do with something that Sage is doing and how the scripts are loaded etc.

Has anyone any idea how to better debug this and what this issue could stem from?

Thanks for any pointers.

My best,
ToMi

2 Likes

Wow, that was fast and did the trick. Thanks so much!