atomicadam
Forum Replies Created
-
So it appears that in the plugin code you’ll remove the gform_pre_render action and replace it with your own in the class.
So, from what I can see, that pretty much nullifies any ability for me to alter the form object in that hook. Correct?
Does this plugin have a hook that is firing after gform_pre_render hook if the shortcode options update has a post ID assigned to it?
Because, what is happening, I the checkbox data I’m altering in the gform_pre_render hook is somehow not actually working when the form is rendered, even though if I var_dump out the form right before returning it in the gform_pre_render hook, the isSelected is set to true, but when the form rendered, the checkboxes are not checked.
But if I remove the post ID from the update option in the shortcode, the checkboxes are checked.
And this all seemed to have gone sideways in the last two weeks, so something in the last couple of updates to the plugin might have changed.
To expand on the issue some –
add_filter('gform_pre_render', 'acf_to_gf_populate_checkbox_static'); add_filter("gform_pre_submission_filter", "acf_to_gf_populate_checkbox_static"); function acf_to_gf_populate_checkbox_static( $form ) { $checkboxes[] = get_post_meta( 30,'checkboxes' ); // hardcode for testing $counter = 0; // for each field in the form foreach($form['fields'] as $fkey=> $field) : // if the field is a check box if( $field['inputType'] == 'checkbox') : // create what will be our new 'choices' array and pre populate it with defaults $choices = $field['choices']; // for each choice foreach( $field['choices'] as $key => $choice ) : // if the choice is in the ACF checkbox array if( in_array( $choice['text'], maybe_unserialize( $checkboxes[$counter][0] ) ) ) : // reset that $choices[$key] with new data so that checkbox will appear checked for user $choices[$key] = array( 'text' => $choice['text'], 'value' => $choice['value'], 'isSelected' => true, 'price' => '' ); endif; endforeach; $counter++; $field['choices'] = $choices; endif; endforeach; return $form; }Above the the basic outline of the function used to set checkboxes in the pre_render hook. If I use [gravityform id=”1″ update] the checkboxes that should be checked, do render checked. If I use [gravityform id=”1″ update=”30″] – those checkboxes are not checked, even though the code in the pre_render hook has not changed.
I was able to work around this by using the add_filter(‘the_content’).
Full code looks like this, and it works. But not sure why echo do_shortcode() isn’t allowing submit button to function.
add_filter('the_content','edit_form'); function edit_form( $content ) { $value = true; if( isset( $_SESSION['project_id'] ) ) : $project_id = sanitize_title( $_SESSION['project_id'] ); $form_id = sanitize_title( $_SESSION['form_id'] ); else: $value = null; endif; if( $value == null) : echo '<h4>Something has gone wrong, please go back to dashboard and try again</h4>'; else : $content = '[gravityform id="'.$form_id.'" update="'.$project_id.'"]'; return $content; endif; }Forum: Plugins
In reply to: [Export Featured Images] Importing featured images failsI get the same thing, did you happen to find a solution or another solution?
Hi messica –
I’m not sure it is resolved since it seems like a solution to a bug in the PMP code. If I did want to filter those things, I wouldn’t be able to. Thus, while my particular needs are resolved, the code bug in PMP isn’t.
Thank you for, was also driving me up the wall trying to figure what was going on. Any ETA for code update and solution?
Forum: Plugins
In reply to: [WP eCommerce] No Emails Being Sent – WP 3.8.1 – WPSC 3.8.13.3Thank you, that fixed it!
Love easy fixes like that.
But you know, I had no idea that the GC was out of date. It didn’t want to update like other plugins. You might want to allow it to say – there is an update – login here… with your API … to get update.
Forum: Plugins
In reply to: [WP eCommerce] No Emails Being Sent – WP 3.8.1 – WPSC 3.8.13.3Hi whitelamp –
Is there no solution w/o hacking the plugin? I’d prefer not to do that if at all possible.
Thanks,
Forum: Plugins
In reply to: [WP eCommerce] No Emails Being Sent – WP 3.8.1 – WPSC 3.8.13.3The GC version is 2.9.7.
And yes, the Gate Way is LinkPoint and it came with the Plugin, I didn’t add on anything for WPSC except for the Gold Cart.
Also – Mihai – I tried to purchase more tokens for 1-1 support – but after I login and put in my API key and fill out the form, it says I need to buy more tokens, but then the page to buy more tokens is totally blank except for a breadcrumb that says home >>.
And thanks for the help.
Forum: Plugins
In reply to: [WP eCommerce] No Emails Being Sent – WP 3.8.1 – WPSC 3.8.13.3Hi whitelamp –
Thanks, it is the LinkPoint gateway from Frist Data.
How can I check if the gateway has been updated, and if not, what should I do to resolve?
Forum: Plugins
In reply to: [Genesis Featured Widget Amplified] custom post info not working correctlyAgreed – Still not working correctly.