El error que recibimos después de la eliminación de un subsitio multisitio es este error en el sitio principal
This is the error
[28-Nov-2024 23:17:19 UTC] PHP Fatal error: Uncaught Error: Attempt to assign property "domain" on null in /var/www/domain_c_usr/data/www/domain.com/wp-content/sunrise.php:22
Stack trace:
#0 /var/www/domain_c_usr/data/www/domain.com/wp-includes/ms-settings.php(47): include_once()
#1 /var/www/domain_c_usr/data/www/domain.com/wp-settings.php(155): require('...')
#2 /var/www/domain_c_usr/data/www/domain.com/wp-config.php(104): require_once('...')
#3 /var/www/domain_c_usr/data/www/domain.com/wp-load.php(50): require_once('...')
#4 /var/www/domain_c_usr/data/www/domain.com/wp-blog-header.php(13): require_once('...')
#5 /var/www/domain_c_usr/data/www/domain.com/index.php(17): require('...')
#6 {main}
thrown in /var/www/domain_c_usr/data/www/domain.com/wp-content/sunrise.php on line 22
en sunrise.php
esto es sobre este bloque
$wpdb->suppress_errors( false );
if( $domain_mapping_id ) {
$current_blog = $wpdb->get_row("SELECT * FROM {$wpdb->blogs} WHERE blog_id = '$domain_mapping_id' LIMIT 1");
$current_blog->domain = $dm_domain;
$current_blog->path="/";
$blog_id = $domain_mapping_id;
$site_id = $current_blog->site_id;define( 'COOKIE_DOMAIN', $dm_domain );
$current_site = $wpdb->get_row( "SELECT * from {$wpdb->site} WHERE id = '{$current_blog->site_id}' LIMIT 0,1" );
$current_site->blog_id = $wpdb->get_var( "SELECT blog_id FROM {$wpdb->blogs} WHERE domain='{$current_site->domain}' AND path="{$current_site->path}"" );
if ( function_exists( 'get_site_option' ) )
$current_site->site_name = get_site_option( 'site_name' );
elseif ( function_exists( 'get_current_site_name' ) )
$current_site = get_current_site_name( $current_site );
define( 'DOMAIN_MAPPING', 1 );
}
Podría agregar un cheque como
...
if( $domain_mapping_id ) {
$current_blog = $wpdb->get_row("SELECT * FROM {$wpdb->blogs} WHERE blog_id = '$domain_mapping_id' LIMIT 1");
// Add null check and error handling
if (!$current_blog) {
error_log("Domain mapping found but blog not found for ID: $domain_mapping_id");
return;
}
$current_blog->domain = $dm_domain;
$current_blog->path="/";
$blog_id = $domain_mapping_id;
$site_id = $current_blog->site_id;
y luego obtengo
[29-Nov-2024 01:36:47 UTC] Domain mapping found but blog not found for ID: 44
Pero, ¿por qué recibiríamos este error en primer lugar? Al marcar veo la carga del sitio principal pero errores 404 para todas las imágenes:
[Error] Failed to load resource: the server responded with a status of 404 () (sanchichon_1280-100x100-1.jpg, line 0)
[Error] Failed to load resource: the server responded with a status of 404 () (dia-de-san-antonio-022_reduced.jpg, line 0)
[Error] Failed to load resource: the server responded with a status of 404 () (Malaga_domain_com-1.jpg, line 0)
[Error] Failed to load resource: the server responded with a status of 404 () (DSC_2435.jpg, line 0)
[Error] Failed to load resource: the server responded with a status of 404 () (Marbella_domain_com-1.jpg, line 0)
[Error] Failed to load resource: the server responded with a status of 404 () (zahara_sierra_lake-720x260-1.jpg, line 0)
[Error] Failed to load resource: the server responded with a status of 404 () (sanchichon_1280-100x100-1.jpg, line 0)
[Error] Failed to load resource: the server responded with a status of 404 () (dia-de-san-antonio-022_reduced.jpg, line 0)
[Error] Failed to load resource: the server responded with a status of 404 () (Malaga_domain_com-1.jpg, line 0)
Cheque eliminado por ahora. Entonces error al cargar.
Este tema fue modificado hace 14 horas y 44 minutos por
.Este tema fue modificado hace 14 horas y 38 minutos por
.Este tema fue modificado hace 14 horas y 33 minutos por
.
La página con la que necesito ayuda: [log in to see the link]