Dear,
I have a form where a generic select is populated by a view. It has been working for years. After upgrade of Toolset plugins, the select field stopped working. I checked similar tickets but didn't help.
here my form's code:
...
[cred_generic_field type='select' field='prof1']
{
"required":0,
"validate_format":0,
"default":[],
"options":[ [wpv-view name="tl-list-dep-staff" ]]
}
...
and here my view tl-list-dep-staff:
[hide-it][wpv-layout-start][/hide-it]
[wpv-items-found]
<!-- wpv-loop-start -->
<wpv-loop>
[wpv-item index=1]{"value":"[wpv-post-title]","label":"[wpv-post-title]"}[wpv-item index=other],{"value":"[wpv-post-title]","label":"[wpv-post-title]"}
</wpv-loop>
<!-- wpv-loop-end -->
[/wpv-items-found]
[hide-it][wpv-layout-end][/hide-it]
with:
add_shortcode('hide-it', 'hide_it_func');
function hide_it_func(){
return;
}
I also tried to remove the [hide-it]...[/hide-it] and use the filter but in vain:
add_filter( 'wpv_filter_wpv_view_shortcode_output', 'prefix_clean_view_output', 5, 2 );
I just answered a similar question where someone was asking about how to set this up, so I went through the steps on my own test site to make sure everything was working, and it does with the current plugin versions and latest WP.
I don't know why it might have stopped working on your site, but I suggest you go through the same steps to set it up again. (From what you've shared it looks like this may have been set up a very long time ago.)
The process is very sensitive to any unexpected white space in the View output, which can easily break things.
When you create the View, you must use the Loop Wizard to generate the markup for the output, choosing the List with Separators option. Choose to add any dummy field to the output (e.g. post title).
Then, when the wizard completes, edit the output section to replace the shortcode to output the dummy field with that required to produce the JSON options. In my case the result was the following: