The results could not be loaded
-
Icon is not sowing, but can’t find out the issue, it’s showing The results could not be loaded and console is showing ajax error. @ould you please help me to solve this issue?
-
Kind of looks like your WordPress admin login has time out/expired. Can you refresh the page and try again?
Actually that would probably be a 401 error if you weren’t authenticated the more I think about it.
Are you able to view the PHP error logs? A 500 error should be logged there and would point us in the right direction as to what is going on.
I found the error file i attached and after line 50ish its all
thrown in /home/gkchef/public_html/costworkgr.gkchef.gr/wp-content/plugins/advanced-custom-fields-font-awesome/assets/inc/class-ACFFA-Loader-5.php on line 106 [18-Jul-2023 16:54:43 UTC] PHP Warning: foreach() argument must be of type array|object, string given in /home/gkchef/public_html/costworkgr.gkchef.gr/wp-content/plugins/advanced-custom-fields-font-awesome/assets/inc/class-ACFFA-Loader-5.php on line 304 [18-Jul-2023 16:54:43 UTC] PHP Fatal error: Uncaught TypeError: in_array(): Argument #2 ($haystack) must be of type array, string given in /home/gkchef/public_html/costworkgr.gkchef.gr/wp-content/plugins/advanced-custom-fields-font-awesome/assets/inc/class-ACFFA-Loader-5.php:106 Stack trace: #0 /home/gkchef/public_html/costworkgr.gkchef.gr/wp-content/plugins/advanced-custom-fields-font-awesome/assets/inc/class-ACFFA-Loader-5.php(106): in_array('custom', '') #1 /home/gkchef/public_html/costworkgr.gkchef.gr/wp-content/plugins/advanced-custom-fields-font-awesome/assets/inc/class-ACFFA-Loader-5.php(75): ACFFA_Loader_5->get_ajax_query(Array) #2 /home/gkchef/public_html/costworkgr.gkchef.gr/wp-includes/class-wp-hook.php(308): ACFFA_Loader_5->select2_ajax_request('') #3 /home/gkchef/public_html/costworkgr.gkchef.gr/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters('', Array) #4 /home/gkchef/public_html/costworkgr.gkchef.gr/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #5 /home/gkchef/public_html/costworkgr.gkchef.gr/wp-admin/admin-ajax.php(188): do_action('wp_ajax_acf/fie...') #6 {main}
so this is the error we get. We didnt find anything else error related except this error that pops up when i go to edit a post (i have enabled debug in config.php) :
Deprecated: ctype_digit(): Argument of type WP_Post will be interpreted as string in the future in /home/gkchef/public_html/costworkgr.gkchef.gr/wp-content/plugins/types/vendor/toolset/toolset-common/inc/autoloaded/field/group/factory.php on line 134
That is definitely helpful here I’m glad you were able to find that. Looking at the code where those errors are appearing, it is in a part of the code that has to do which of the FontAwesome icon sets are activated.
The code expects this to be an array of the active icon sets as selected when you created the FontAwesome field in your ACF field group. For some reason on your site this isn’t an array. I’m not sure how it got this way but one of two things is happening:
- The settings for that FontAwesome field in your field group are somehow corrupted. Going back into the ACF field group where this field is, you can try unselecting/reselecting the icon sets (solid, regular, light, etc) that you want to use with this field and resaving that field group.
- There is some custom code you have in place to filter the value of the icon sets using the ‘ACFFA_active_icon_sets’ filter, and it is returning a string value. You’d probably know if this was the case as it would be something you or another developer did on your site. I don’t imagine any other code from a theme or plugin would be messing with this value.
Let me know if resaving the settings in that field group resolves this issue for you. If not the next steps may be to log the values in that part of the code to see what is happening. Example:
- Open the file for editing: /home/gkchef/public_html/costworkgr.gkchef.gr/wp-content/plugins/advanced-custom-fields-font-awesome/assets/inc/class-ACFFA-Loader-5.php
- Change the code on lines #102/#103 to be:
$active_icon_sets = isset( $field['icon_sets'] ) ? $field['icon_sets'] : []; file_put_contents($_SERVER['DOCUMENT_ROOT'] . '/log_icon_set_1.txt', print_r($active_icon_sets, true)); $active_icon_sets = apply_filters( 'ACFFA_active_icon_sets', $active_icon_sets ); file_put_contents($_SERVER['DOCUMENT_ROOT'] . '/log_icon_set_2.txt', print_r($active_icon_sets, true));
3. Go back to your post and try to search for an icon
4. Look for the log_icon_set_1.txt and log_icon_set_2.txt files in the html root of your server ( /home/gkchef/public_html/costworkgr.gkchef.gr/ )
5. Post back the content of these files for further debuggingNote: this kind of debugging work is best done on a local environment or staging server. If this is a production environment make sure you are comfortable with the above tests before proceeding and don’t forget to roll back your changes when you are done testing.
Thanks, after adding the field newly from Dashboard everything is working well.
Thanks a lot for your support!
Good to hear it!
- The topic ‘The results could not be loaded’ is closed to new replies.