I'm using a Cred generic field and have created a Views in order to populate the options. The Views result is fine and I have been able to verify that this is inline with the options rules.
Now, I'm facing 2 issues :
1. I cannot define a default option in the generic field. If I place a Views field, it is not taken into consideration.
2. If there is a " inside the text that is returned by the Views, then the generic field does not display. This point is critical when you use front end inputs to populate the Views ! (ie : when the Views list the title of the posts created by users).
Hello. Thank you for contacting the Toolset support.
1. I cannot define a default option in the generic field. If I place a Views field, it is not taken into consideration.
=> Can you please share the generic field you code you are using?
2. If there is a " inside the text that is returned by the Views, then the generic field does not display. This point is critical when you use front end inputs to populate the Views ! (ie : when the Views list the title of the posts created by users).
=> I think you need to parse the value while you are generating as JSON before you pass to the generic field. Can I have problem URL and access details?
*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.
I have set the next reply to private which means only you and I have access to it.
Sorry but it's not possible for the moment to give you access. Here is some complementary info :
1. Generic field code. It is used in a Cred modification to retrieve a field from the post and give the oportunity to chose another product (the Views shortcode gives the list of potential products).
2. Result of the shortcode when using " character :
{"value":"Cours "bellissima" 2018","Cours "bellissima" 2018":""}
This is blocking the display of the generic field
1. Generic field code. It is used in a Cred modification to retrieve a field from the post and give the oportunity to chose another product (the Views shortcode gives the list of potential products).
==> As you can see, I've added types shortcode with the specific post ID to get value from and I see the option is set selected.
[cred_generic_field type='select' field='test-select-field']
{
"required":0,
"default":"[types field='property-bathrooms' item='1591'][/types]",
"options":[{"value":"1","label":"one"},{"value":"2","label":"two \"bellissima\" 2 "},{"value":"3","label":"three"}]
}
[/cred_generic_field]
2. Result of the shortcode when using " character :
{"value":"Cours "bellissima" 2018","Cours "bellissima" 2018":""}
==> Again, you need to escape the quotes. So to add the string with quotes you should use as given under:
Thanks for the info.
I'm not able to use it as you propose as this is a front-end submission and I can't control what the user will use as title.
I will setup a cred_save_data in order to re-write the title and delete the unwanted signs.
Regards
Pat