HyperDB icon indicating copy to clipboard operation
HyperDB copied to clipboard

Fatal error: Uncaught Error: Attempt to assign property "post_content"

Open hj-collab opened this issue 2 years ago • 3 comments

Hello,

I have a WP network site. I am getting the below error when trying to create a new post. I am using the latest HyperDB from this repo.

Fatal error: Uncaught Error: Attempt to assign property "post_content" on null in /var/www/wp-admin/includes/post.php:762 Stack trace: #0 /var/www/wp-admin/post-new.php(66): get_default_post_to_edit() #1 {main} thrown in /var/www/wp-admin/includes/post.php on line 762 Configuration of db-config.php

<?php
/**
 * Register the primary server to HyperDB
 */
$wpdb->add_database( array(
        'host'     => 'xxx',
        'user'     => 'xxx',
        'password' => 'xxx',
        'name'     => 'xxx',
        'write'    => 1, // primary server takes write queries
        'read'     => 0,

) );

$wpdb->add_database( array(
        'host'     => 'localhost',
        'user'     => 'xxx',
        'password' => 'xxx',
        'name'     => 'xxx',
        'write'    => 0, 
        'read'     => 1, // read from local replica server

) );

Please help! Thank you!

hj-collab avatar May 22 '23 06:05 hj-collab

Hi @sjinks,

I believe the above error is related to https://github.com/Automattic/HyperDB/pull/105.

Shouldn't the aforementioned request be merged? Why does Automattic have so many broken things on their repositories? I apologize, but I'm a bit disappointed.

I have switched to a fork of LudicrousDB until this is fixed. I hope some time and attention is given to HyperDB.

hj-collab avatar May 30 '23 18:05 hj-collab

Please merge the pending pull requests. I have forked the HyperDB repo for now. https://github.com/Automattic/HyperDB/pull/135

hj-collab avatar May 31 '23 07:05 hj-collab

@vnsavage could you please take a look?

sjinks avatar May 31 '23 07:05 sjinks