Skip to content

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

@hj-collab

Description

@hj-collab

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions