Skip Navigation

[Resolved] I get a error rendering type fields

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 1 reply, has 2 voices.

Last updated by Minesh 1 year, 4 months ago.

Assisted by: Minesh.

Author
Posts
#2761529

Tell us what you are trying to do?
I try with code render types field , using the types render field , I have used it on other websites hundreds of times but now I don't know why when I install the new version of toolset, it spits out this error when I try to do it

$postid="287";
$sexo=types_render_field('sexo', array("item" => $postid ))

and get that error

[27-Sep-2024 08:51:53 UTC] PHP Fatal error: Uncaught Error: Class 'Types_Post_Service' not found in /var/www/5e70284b-cfc9-4829-972b-04b5c5a81c32/public_html/wp-content/plugins/types/application/functions_public.php:50
Stack trace:
#0 /var/www/5e70284b-cfc9-4829-972b-04b5c5a81c32/public_html/wp-content/plugins/types/application/functions_public.php(34): types_render_postmeta('sexo', Array, NULL)
#1 /var/www/5e70284b-cfc9-4829-972b-04b5c5a81c32/public_html/wp-content/plugins/code-snippets/php/snippet-ops.php(582) : eval()'d code(25): types_render_field('sexo', Array)
#2 /var/www/5e70284b-cfc9-4829-972b-04b5c5a81c32/public_html/wp-content/plugins/code-snippets/php/snippet-ops.php(582): eval()
#3 /var/www/5e70284b-cfc9-4829-972b-04b5c5a81c32/public_html/wp-content/plugins/code-snippets/php/snippet-ops.php(663): Code_Snippets\execute_snippet('$seconddb = new...', 9)
#4 /var/www/5e70284b-cfc9-4829-972b-04b5c5a81c32/public_html/wp-includes/class-wp-hook.php(324): Code_Snippets\execute_active_snippets('')
#5 /var/www/5e70284b-cfc9-4829-972b-04b5c5a81c32/publi in /var/www/5e70284b-cfc9-4829-972b-04b5c5a81c32/public_html/wp-content/plugins/types/application/functions_public.php on line 50

what happen?

#2761556

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Can you please tell me where exactly within what file and hook you are using the Types PHP API function types_render_field?

Can you please share URL of post/page where I can see the issue and also tell me what is your expected result.

*** 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.

#2761836

well its little stupid but the was the snipped addon who was blocking the request. Dont know why but if use the fuction execute code one time the types its blocked.