Skip to content

Commit

Permalink
fix: domain names for wp_blogs table
Browse files Browse the repository at this point in the history
  • Loading branch information
sjinks committed Dec 9, 2024
1 parent d847c80 commit 8de9597
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/commands/dev-env-sync-sql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,9 @@ CALL vip_sync_update_blog_domains();
DROP PROCEDURE vip_sync_update_blog_domains;
`;

const primaryUrl = networkSites.find( site => site?.blogId === 1 )?.homeUrl;
const primaryDomain = primaryUrl ? new URL( primaryUrl ).hostname : '';

const queries: string[] = [];
for ( const site of networkSites ) {
if ( ! site?.blogId || ! site?.homeUrl ) {
Expand All @@ -280,7 +283,7 @@ DROP PROCEDURE vip_sync_update_blog_domains;

const oldDomain = new URL( site.homeUrl ).hostname;
const newDomain =
site.blogId !== 1
primaryDomain !== oldDomain
? `${ this.slugifyDomain( oldDomain ) }.${ this.landoDomain }`
: this.landoDomain;

Expand Down

0 comments on commit 8de9597

Please sign in to comment.