• Resolved Norm Sash

    (@normsash)


    I’m running into this issue when trying to do some performance testing with Code Profiler .

    Code Profiler makes an AJAX call to load a page and profile it (it’s not loaded on the front-end.)

    When running Code Profiler I’m getting the Uncaught TypeError: PodsAPI.php:824 in the server error log and Code Profiler hangs. If I just display the page on the front-end I don’t see the error in the logs.

    Seems like something is different when the page is loaded via AJAX.

    [19-Jun-2024 11:08:31 UTC] PHP Fatal error: Uncaught TypeError: Cannot access offset of type string on string in /wp-content/plugins/pods/classes/PodsAPI.php:824
    Stack trace:
    #0 /wp-content/plugins/pods/src/Pods/Whatsit/Pod.php(127): PodsAPI->get_wp_object_fields()
    #1 /wp-content/plugins/pods/src/Pods/Whatsit.php(1229): Pods\Whatsit\Pod->get_object_fields()
    #2 /wp-content/plugins/pods/includes/general.php(4474): Pods\Whatsit->get_all_fields()
    #3 /wp-content/plugins/pods/classes/Pods.php(432): pods_config_get_all_fields()
    #4 /wp-content/plugins/pods-beaver-builder-themer-add-on/classes/class-pods-beaver-page-data.php(652): Pods->fields()
    #5 /wp-content/plugins/pods-beaver-builder-themer-add-on/classes/class-pods-beaver-page-data.php(452): PodsBeaverPageData::recurse_pod_fields()
    #6 /wp-content/plugins/bb-plugin/classes/class-fl-builder-ui-settings-forms.php(317): PodsBeaverPageData::pods_get_fields()
    #7 /wp-content/plugins/bb-plugin/classes/class-fl-builder-ui-settings-forms.php(274): FLBuilderUISettingsForms::prep_field_for_js_config()
    #8 /wp-content/plugins/bb-plugin/classes/class-fl-builder-ui-settings-forms.php(169): FLBuilderUISettingsForms::prep_forms_for_js_config()
    #9 /wp-content/plugins/bb-plugin/classes/class-fl-builder-ui-settings-forms.php(156): FLBuilderUISettingsForms::get_js_config()
    #10 /wp-includes/class-wp-hook.php(324): FLBuilderUISettingsForms::init_js_config()
    #11 /wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()
    #12 /wp-includes/plugin.php(517): WP_Hook->do_action()
    #13 /wp-includes/general-template.php(3066): do_action()
    #14 /wp-content/themes/bb-theme/footer.php(34): wp_footer()
    #15 /wp-includes/template.php(810): require_once('/...')\n#16 /wp-includes/template.php(745): load_template()
    #17 /wp-includes/general-template.php(92): locate_template()
    #18 /wp-content/themes/bb-theme/page.php(18): get_footer()
    #19 /wp-content/plugins/breakdance/plugin/render/capture-wordpress-output.php(96): include('/...')\n#20 /wp-content/plugins/breakdance/plugin/render/capture-wordpress-output.php(77): Breakdance\\Render\\getWordPressHtmlOutput()
    #21 /wp-content/plugins/breakdance/plugin/actions_filters/template_include.php(56): Breakdance\\Render\\getWordPressHtmlOutputWithHeaderAndFooterDependenciesAddedAndDisplayIt()
    #22 /wp-includes/class-wp-hook.php(324): Breakdance\\ActionsFilters\\template_include()
    #23 /wp-includes/plugin.php(205): WP_Hook->apply_filters()
    #24 /wp-includes/template-loader.php(104): apply_filters()
    #25 /wp-blog-header.php(19): require_once('/...')\n#26 /index.php(17): require('/...')\n#27 {main}\nthrown in /wp-content/plugins/pods/classes/PodsAPI.php on line 824
Viewing 1 replies (of 1 total)
  • Plugin Support Paul Clark

    (@pdclark)

    The error log is referencing this line, where cannot access offset of type string on string likely refers to $fields[ $taxonomy->name ], where the name of a related taxonomy is being accessed on $fields, which is supposed to be an array, but has instead arrived as text.

    The other lines in the log indicate that Beaver Builder is attempting to go through all Pods fields, and that plugins/breakdance/plugin/actions_filters might be attempting to simulate a template render and output in a non-standard way for debug purposes.

    Without digging through the code execution step-by-step, it seems like one of these filters or debug tools may be caused $fields to be transformed into text instead of an array containing fields.

    This could happen either if the plugins/filters change the value, set the cache, or attempt to access the fields before they have initialized, such as before init at priority 20-ish.

    The easiest verification would be to test with a different debug tool or theme.

    Further information may require feedback from the authors of Beaver Builder or breakdance/plugin/actions_filters as to how those debug functions operate and whether they are executed with the correct timing or according to their intended purpose.

Viewing 1 replies (of 1 total)
  • The topic ‘Uncaught TypeError: PodsAPI.php:824’ is closed to new replies.