WAIT: Existing page cannot be edited due to an unknown error

Browser: Firefox 137.0.2
OS: Windows

I was editing a page in Bricksbuilder and added some images to a frames template while my brother was working on the footer template and this ultimately lead to us no longer being able to access the page in the builder. However, it is possible to create and edit a new page. The error message is as follows:

Fatal error: Uncaught TypeError: array_column(): Argument #1 ($array) must be of type array, string given in C:\Users\manue\Local Sites\mosterei-gronbach\app\public\wp-content\themes\bricks\includes\elements\base.php:4287 Stack trace: #0 C:\Users\manue\Local Sites\mosterei-gronbach\app\public\wp-content\themes\bricks\includes\elements\base.php(4287): array_column(‘’, ‘id’) #1 C:\Users\manue\Local Sites\mosterei-gronbach\app\public\wp-content\themes\bricks\includes\elements\image.php(712): Bricks\Element->element_classes_have(Array) #2 C:\Users\manue\Local Sites\mosterei-gronbach\app\public\wp-content\themes\bricks\includes\elements\base.php(2633): Bricks\Element_Image->render() #3 C:\Users\manue\Local Sites\mosterei-gronbach\app\public\wp-content\themes\bricks\includes\ajax.php(477): Bricks\Element->init() #4 C:\Users\manue\Local Sites\mosterei-gronbach\app\public\wp-content\themes\bricks\includes\builder.php(1556): Bricks\Ajax::render_element(Array) #5 C:\Users\manue\Local Sites\mosterei-gronbach\app\public\wp-content\themes\bricks\includes\builder.php(1393): Bricks\Builder::query_content_type_for_elements_html(Array, 27) #6 C:\Users\manue\Local Sites\mosterei-gronbach\app\public\wp-content\themes\bricks\includes\builder.php(297): Bricks\Builder::builder_data(27) #7 C:\Users\manue\Local Sites\mosterei-gronbach\app\public\wp-includes\class-wp-hook.php(324): Bricks\Builder->enqueue_scripts(‘’) #8 C:\Users\manue\Local Sites\mosterei-gronbach\app\public\wp-includes\class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array) #9 C:\Users\manue\Local Sites\mosterei-gronbach\app\public\wp-includes\plugin.php(517): WP_Hook->do_action(Array) #10 C:\Users\manue\Local Sites\mosterei-gronbach\app\public\wp-includes\script-loader.php(2277): do_action(‘wp_enqueue_scri…’) #11 C:\Users\manue\Local Sites\mosterei-gronbach\app\public\wp-includes\class-wp-hook.php(324): wp_enqueue_scripts(‘’) #12 C:\Users\manue\Local Sites\mosterei-gronbach\app\public\wp-includes\class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array) #13 C:\Users\manue\Local Sites\mosterei-gronbach\app\public\wp-includes\plugin.php(517): WP_Hook->do_action(Array) #14 C:\Users\manue\Local Sites\mosterei-gronbach\app\public\wp-includes\general-template.php(3192): do_action(‘wp_head’) #15 C:\Users\manue\Local Sites\mosterei-gronbach\app\public\wp-content\themes\bricks\header.php(7): wp_head() #16 C:\Users\manue\Local Sites\mosterei-gronbach\app\public\wp-includes\template.php(810): require_once(‘C:\Users\manue\…’) #17 C:\Users\manue\Local Sites\mosterei-gronbach\app\public\wp-includes\template.php(745): load_template(‘C:\Users\manue\…’, true, Array) #18 C:\Users\manue\Local Sites\mosterei-gronbach\app\public\wp-includes\general-template.php(48): locate_template(Array, true, true, Array) #19 C:\Users\manue\Local Sites\mosterei-gronbach\app\public\wp-content\themes\bricks\template-parts\builder.php(2): get_header() #20 C:\Users\manue\Local Sites\mosterei-gronbach\app\public\wp-includes\template-loader.php(106): include(‘C:\Users\manue\…’) #21 C:\Users\manue\Local Sites\mosterei-gronbach\app\public\wp-blog-header.php(19): require_once(‘C:\Users\manue\…’) #22 C:\Users\manue\Local Sites\mosterei-gronbach\app\public\index.php(17): require(‘C:\Users\manue\…’) #23 {main} thrown in C:\Users\manue\Local Sites\mosterei-gronbach\app\public\wp-content\themes\bricks\includes\elements\base.php on line 4287

I hosted the site via Local.

I’m new to bricks and webdesign in general so if you need further information I will try to give it to you as far as I can.

Hi Manuel,
Welcome to the forum, and thanks so much for your report!

The error message indicates where the error is coming from and how it can possibly be rectified. As this is a local installation and we cannot access it, please try the following:

Open the file Bricks/includes/elements/base.php and change the following line:

$global_classes = Database::$global_data['globalClasses'];

to

$global_classes = Database::$global_data['globalClasses'] ?? [];

Let me know if it solves the issue so we can add this fix to the next release.

Best regards,
timmse

Hi timmse,

Thank you very much for your quick reply!

I have inserted your change in the base.php, but unfortunately the same error message is still displayed.

Ok, it was worth a try. Then we definitely need access to the website. Please clone the installation into a live installation and send temporary login credentials and a link to this thread to help@bricksbuilder.io using the email address you used during the purchase.

@timmse I’m the brother of @MrDonhank. I took a look at it again and could gain some insights about the error I’d like to share. I could make the site work again by inserting:

if (!is_array($global_classes)) {
				$global_classes = []; 
			}
		

before

	$class_index = array_search( $element_class, array_column( $global_classes, 'id' ) );

I guess your suggestion would have worked as well, when it would have checked for empty or data-type instead of null.

But that’s just a sidenote.
The page builder was now loading again BUT all classes disappeared.
The real problem was that in the wp_options table the value of the key ‘bricks_global_classes’ was plain empty. If I’m right that’s where all global class data is stored.

I guess the problem occured while we were both working on the site. I was working on a header, my brother on a page. We hadn’t been aware of the Global Data Sync-Setting, so it wasn’t enabled. I guess it should’ve prevented this issue. Can’t tell! Hope this helps!

Hi @Tobsen ,
As already requested, please clone the installation to a server and send login credentials via email, so we can test and find the most appropriate fix. Thank you!

I have the same problem. the problem is from Automatic css plugin on my side. Try to disable and reactivate it