Hube2 / acf-medium-editor

Configurable Medium Editor WYSIWYG Field for ACF5 Pro
77 stars 10 forks source link

REST API error when using acf_medium as repeater subfield #34

Open lavin1337 opened 2 years ago

lavin1337 commented 2 years ago

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```
Hube2 commented 2 years ago

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

husseincak commented 2 years ago

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 commented 2 years ago

Same error here