File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -132,9 +132,9 @@ public function output_script() {
132132
133133 self.setupPeidField = function() {
134134
135- var gpnfCookie = $.parseJSON( self.getCookie( 'gpnf_form_session_{0}'.gformFormat( self.formId ) ) );
135+ var gpnfCookie = $.parseJSON( self.getCookie( self.cookieName ) );
136136
137- if ( ! self.$peidField.val() ) {
137+ if ( ! self.$peidField.val() && gpnfCookie ) {
138138 self.$peidField
139139 .val( gpnfCookie.hash )
140140 .change();
@@ -182,6 +182,7 @@ public function add_init_script( $form ) {
182182 'formId ' => $ form ['id ' ],
183183 'fieldId ' => $ this ->get_parent_entry_id_field ( $ form ),
184184 'nestedFormFieldIds ' => wp_list_pluck ( $ this ->get_nested_form_fields ( $ form ), 'id ' ),
185+ 'cookieName ' => ( new GPNF_Session ( $ form ['id ' ] ) )->get_cookie_name (),
185186 );
186187
187188 $ script = 'new GPPAPopulateChildEntries( ' . json_encode ( $ args ) . ' ); ' ;
You can’t perform that action at this time.
0 commit comments