Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

REST API error when using acf_medium as repeater subfield #34

Open
lavin1337 opened this issue Jan 12, 2022 · 3 comments
Open

REST API error when using acf_medium as repeater subfield #34

lavin1337 opened this issue Jan 12, 2022 · 3 comments

Comments

@lavin1337
Copy link

lavin1337 commented Jan 12, 2022

When I set a repeater subfield to Medium Editor:

in /var/www/html/wp-content/plugins/advanced-custom-fields-pro/includes/rest-api/acf-rest-api-functions.php on line 11

Call stack:

acf_get_field_rest_schema()
wp-content/plugins/advanced-custom-fields-pro/pro/fields/class-acf-field-repeater.php:1132
acf_field_repeater::get_rest_schema()
wp-content/plugins/advanced-custom-fields-pro/includes/rest-api/acf-rest-api-functions.php:11
acf_get_field_rest_schema()
wp-content/plugins/advanced-custom-fields-pro/includes/rest-api/class-acf-rest-api.php:112
ACF_Rest_Api::get_schema()
wp-content/plugins/advanced-custom-fields-pro/includes/rest-api/class-acf-rest-api.php:64
ACF_Rest_Api::register_field()
wp-content/plugins/advanced-custom-fields-pro/includes/rest-api/class-acf-rest-api.php:35
ACF_Rest_Api::initialize()
wp-includes/class-wp-hook.php:303
WP_Hook::apply_filters()
wp-includes/class-wp-hook.php:327
WP_Hook::do_action()
wp-includes/plugin.php:470
do_action()
wp-includes/rest-api.php:537
rest_get_server()
wp-includes/rest-api.php:363
rest_api_loaded()
wp-includes/class-wp-hook.php:303
WP_Hook::apply_filters()
wp-includes/class-wp-hook.php:327
WP_Hook::do_action()
wp-includes/plugin.php:518
do_action_ref_array()
wp-includes/class-wp.php:388
WP::parse_request()
wp-includes/class-wp.php:750
WP::main()
wp-includes/functions.php:1291
wp()
wp-blog-header.php:16
require()
index.php:17```
@lavin1337 lavin1337 changed the title REST API error when using acf_medium field inside a repeater REST API error when using acf_medium as repeater subfield Jan 12, 2022
@Hube2
Copy link
Owner

Hube2 commented Jan 13, 2022

What is the error? What you pasted is cut off at the beginning.

@husseincak
Copy link

husseincak commented Mar 2, 2022

Hi @Hube2 , I'm also having this error. I have verified that the error appears with versions 5.11.4 and 5.12 of Advanced Custom Fields Pro. With version 5.10.2 and 5.11.2 it does not appear, so I have made a rollback to that version.

The problem also appears when you enter with Gutemberg to edit any post, as this consumes the API.

Also, even when the field is not a subfield, the info doesn't appear in the API.

I can provide full access to a WP instalation if needed. I am also looking to see if I could do a PR to fix the problem, but I would need a little guidance on where to start looking as I am not an expert developer.

<b>Fatal error</b>:  Uncaught Error: Call to undefined method stdClass::get_rest_schema() in /home/acftest/public_html/wp-content/plugins/advanced-custom-fields-pro/includes/rest-api/acf-rest-api-functions.php:11
Stack trace:
#0 /home/acftest/public_html/wp-content/plugins/advanced-custom-fields-pro/includes/fields/class-acf-field-group.php(676): acf_get_field_rest_schema(Array)
#1 /home/acftest/public_html/wp-content/plugins/advanced-custom-fields-pro/includes/rest-api/acf-rest-api-functions.php(11): acf_field__group-&gt;get_rest_schema(Array)
#2 /home/acftest/public_html/wp-content/plugins/advanced-custom-fields-pro/includes/rest-api/class-acf-rest-api.php(112): acf_get_field_rest_schema(Array)
#3 /home/acftest/public_html/wp-content/plugins/advanced-custom-fields-pro/includes/rest-api/class-acf-rest-api.php(64): ACF_Rest_Api-&gt;get_schema()
#4 /home/acftest/public_html/wp-content/plugins/advanced-custom-fields-pro/includes/rest-api/cl
Duplicate of #ass-acf-rest-api.php(35): ACF_Rest_Api-&gt;register_field()
#5 /home/acftest/public_html/wp-includes/c in <b>/home/acftest/public_html/wp-content/plugins/advanced-custom-fields-pro/includes/rest-api/acf-rest-api-functions.php</b> on line <b>11</b><br />

Captura de pantalla 2022-03-02 a las 12 29 18

@will83
Copy link

will83 commented Jul 2, 2022

Same error here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants