SOLVED: Bricks + Toolset Types; fatal error after saving (repeater?) custom fields config

Browser: Chrome 113
OS: Windows 10
URL: site in development

  • PHP 8.1
  • Percona Server 8.0.32
  • Latest WP
  • Bricks 1.8.0-beta2 (also beta3 and 1.7.3)
  • Toolset Types, Forms, Blocks (I think?)
  • A few other plugins? (Query Monitor, Gridpane’s tools, etc.)

Been doodling with the beta and working on a site rebuild. I’ve run into this a few times and I’m not positive of the exact steps, but it seems like saving a (new?) repeater group in Toolset Types’ Custom Fields properties is causing an unrecoverable fatal error in Bricks’ dynamic data integration. I can’t remember if it was the same steps each time I’ve run into this. At one point I thought it might be a field name thing, or perhaps trying to nest repeater fields incorrectly, but I’m not really sure that either is the case. The only solution is disabling one of the problematic tools (Bricks or Types), and then trying to remove the offending fields from the DB.

It’s difficult to know which dev to contact, but I think this is something for the Bricks side to fix? If you need more info, let me know.

Stack trace:

[05-Jun-2023 04:16:04 UTC] PHP Fatal error:  Uncaught TypeError: Cannot access offset of type string on string in /var/www/<site>/htdocs/wp-content/themes/bricks/includes/integrations/dynamic-data/providers/provider-toolset.php:51
Stack trace:
#0 /var/www/<site>/htdocs/wp-content/themes/bricks/includes/integrations/dynamic-data/providers/provider-toolset.php(14): Bricks\Integrations\Dynamic_Data\Providers\Provider_Toolset::get_fields()
#1 /var/www/<site>/htdocs/wp-content/themes/bricks/includes/integrations/dynamic-data/providers/base.php(71): Bricks\Integrations\Dynamic_Data\Providers\Provider_Toolset->register_tags()
#2 /var/www/<site>/htdocs/wp-content/themes/bricks/includes/integrations/dynamic-data/providers.php(71): Bricks\Integrations\Dynamic_Data\Providers\Base->get_tags()
#3 /var/www/<site>/htdocs/wp-includes/class-wp-hook.php(308): Bricks\Integrations\Dynamic_Data\Providers->register_tags()
#4 /var/www/<site>/htdocs/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters()
#5 /var/www/<site>/htdocs/wp-includes/plugin.php(517): WP_Hook->do_action()
#6 /var/www/<site>/htdocs/wp-admin/admin-ajax.php(45): do_action()
#7 {main}
  thrown in /var/www/<site>/htdocs/wp-content/themes/bricks/includes/integrations/dynamic-data/providers/provider-toolset.php on line 51

Hey Jon,

thanks for your report.

Without the exact steps to reproduce the issue it’s pretty hard to tell what the issue is. So it’d probably be the best if you could provide us with those and/or temporary credentials to a problematic site the next time you stumble upon the issue. Then we can investigate and see if there is something to fix on our end.

Best,

André

Hi André,

One thing I did note that I hadn’t noticed before was that I was on Types 3.4.16. I updated to the latest, 3.4.19, and tried re-enabling Bricks (child, unedited) and it immediately fatal errored. I’ve updated to Bricks 1.8, too, and no difference.

I have what I believe to be an export of my Types configuration as an XML before and after the issue appeared. I can’t be 100% certain, but I’m in the 90’s% that the first config was when it was working fine. I brought them into WinMerge to see the diff, and it looks like the diffs are seemingly related to a Fields Group or a Fields Repeater. If you have Types available, presumably you could import the XML(s) to test.

https://drive.google.com/drive/folders/1xeQUTkgah9E9Bzou8OUR9mi8g-3wSs7q?usp=sharing

Also, here is another similar (but slightly different) stack trace:

[08-Jun-2023 03:13:23 UTC] PHP Fatal error:  Uncaught TypeError: Cannot access offset of type string on string in /var/www/<site>/htdocs/wp-content/themes/bricks/includes/integrations/dynamic-data/providers/provider-toolset.php:51
Stack trace:
#0 /var/www/<site>/htdocs/wp-content/themes/bricks/includes/integrations/dynamic-data/providers/provider-toolset.php(14): Bricks\Integrations\Dynamic_Data\Providers\Provider_Toolset::get_fields()
#1 /var/www/<site>/htdocs/wp-content/themes/bricks/includes/integrations/dynamic-data/providers/base.php(71): Bricks\Integrations\Dynamic_Data\Providers\Provider_Toolset->register_tags()
#2 /var/www/<site>/htdocs/wp-content/themes/bricks/includes/integrations/dynamic-data/providers.php(71): Bricks\Integrations\Dynamic_Data\Providers\Base->get_tags()
#3 /var/www/<site>/htdocs/wp-includes/class-wp-hook.php(308): Bricks\Integrations\Dynamic_Data\Providers->register_tags()
#4 /var/www/<site>/htdocs/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters()
#5 /var/www/<site>/htdocs/wp-includes/plugin.php(565): WP_Hook->do_action()
#6 /var/www/<site>/htdocs/wp-includes/class-wp.php(797): do_action_ref_array()
#7 /var/www/<site>/htdocs/wp-includes/functions.php(1334): WP->main()
#8 /var/www/<site>/htdocs/wp-blog-header.php(16): wp()
#9 /var/www/<site>/htdocs/index.php(17): require('...')
#10 {main}
  thrown in /var/www/<site>/htdocs/wp-content/themes/bricks/includes/integrations/dynamic-data/providers/provider-toolset.php on line 51

@aslotta is that enough info to investigate?

ok, 100% it’s the repeater field.

  • Disabled Bricks, enabled Twentytwentytwo.
  • Deleted the repeater field that was in the config XML from my attachment.
  • Re-enabled Bricks (child). No crash.
  • Added a new repeater field to a field group. Saved. Immediate fatal error.

This fatal error does not occur with the standard twentytwentytwo theme, so it’s a conflict with how Bricks is reading the data coming from Toolset Types.

jamdev recording: Jam

Hey Jon,

in the meantime I was able to reproduce the issue and added it to our bug tracker.

Thanks again for your report!

Best,

André

1 Like

Hi,
We’ve fixed this bug in Bricks 1.8.2, now available as a one-click update in your WordPress Dashboard.

Please let us know if you are still experiencing issues.

Best regards,
timmse

1 Like