Weird issue with [get param]

By: shaun haage | Asked: 11/08/2023
ForumsCategory: General questionsWeird issue with [get param]
shaun haage asked 1 year ago

I am creating an advanced conditional form that requires frontend editing via a view that I have created.

If "Allow front-end editing of entries" is enabled on the form settings, [get param] IS NOT returning a value.

If "Allow front-end editing of entries" is disabled on the form settings, [get param] IS returning a value.

Has anyone experienced this before? Is there a workaround for this? My form is a staged application, first stage is apply. from the list view I created for the entries if they edit the page a page with a parameter attached, certain fields needs to be added or removed. These conditions are very important to our workflow. Any thoughts here would be greatly appreciated. Kind Regards

even trying to programmatically adjust it using the below isnt working:


add_filter('frm_get_default_value', 'my_custom_default_value', 10, 3);
function my_custom_default_value( $new_value, $field, $is_default ) {
if ( $field->id == 296 ) { //change 25 to the ID of the field
$new_value = 'true'; //change 'default' to your default value
}
return $new_value;
}

1 Answers
Victor Font answered 1 year ago
[get param] requires the use of a query string in the link. [get param] executes on the server. If you want to set a parameter without a query string, you need to use [frm-set-get param_name="value"]. https://formidableforms.com/knowledgebase/shortcodes/#kb-set-values-for-views-and-forms
shaun haage replied 1 year ago

Thanks victor. But I am still having trouble.

https://www.justdieselperformance.com.au/approve-warranty/

from my view I am using [editlink label=0 page_id=17024]&is_checklist=true, which in-turn generates.

https://www.justdieselperformance.com.au/warranty-application/?frm_action=edit&entry=4028&is_checklist=true

Without user session this works as expected. If the user session is established then [frm-set-get param_name="is_checklist"] [get param="is_checklist"] dont return values.

If however I disable "Allow front-end editing of entries" then it works as expected.

I am confused as there are no conflicts that I can see

Victor Font replied 1 year ago

You're using frm-set-get incorrectly. The documentation says the correct usage is: [frm-set-get param_name="value"]. This means your code should read [frm-set-get is_checklist="true"]

shaun haage replied 1 year ago

@Victor Font What I have picked up here us that if authenticated the value is not being set, however the data-frmval is getting the correct value.

On a section widget I have a condition that checks if the checklist field contains the value "true" this is where the shortcodes have been added.

https://snipboard.io/pm9Wix.jpg

Victor Font replied 1 year ago

What you have set in the checklist field in wrong. As explained in the KnowledgeBase, Formidable does not have a show_param shortcode unless you created it as custom snippet. Even if you did, show_param is not used in forms, views, or other Formidable contexts. If you created the show_param shortcode, it is only to be used in WordPress posts and pages. The KnowledgeBase says,

"Note: [get param="param-name"] works in forms, Views, and other Formidable contexts. [show_param] would only be needed in non-Formidable contexts, like WordPress pages and posts."

I gave you the correct answer before. The shortcode to use in this context is:

[get param="is_checklist"]

shaun haage replied 1 year ago

Hi @Victor Font, I appreciate the time taken to help me out here. I have myself implemented each iteration and change the code a a few times, however I am not making any progress, I have however been able to put together a quick loom (I hope this is acceptable) https://www.loom.com/share/98aa3f3a6a544c2b870eeb6fb797aaa6?sid=b90724cd-7394-4790-bae2-31ba9292c012

It still appears that if a user session is established and an entry parameter from the edit link is passed that the param values are not being passed and I am actually wondering if I need to go full js on this one instead. Again, thanks for all the assistance.

Making the Best WordPress Plugin even better - Together

Take on bigger projects with confidence knowing you have access to an entire community of Formidable Experts and Professionals who have your back when the going gets tough. You got this!
Join the community
crossarrow-right