Skip to content

Social: Fix admin page images not loading on Simple #43636

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fixed

Fixed webpack publicPath issue for Social admin.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import '../../set-webpack-public-path';
import { ThemeProvider } from '@automattic/jetpack-components';
import * as WPElement from '@wordpress/element';
import React from 'react';
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/* exported __webpack_public_path__ */
/* global __webpack_public_path__ */

/**
* Dynamically set WebPack's publicPath so that split assets can be found.
* This ensures that assets (like images) are loaded from the correct path
* regardless of the environment (WordPress.com, Simple sites, etc.).
*/
if ( typeof window === 'object' && window.JetpackScriptData?.social?.urls?.webpackPublicPath ) {
// eslint-disable-next-line no-global-assign
__webpack_public_path__ = window.JetpackScriptData.social.urls.webpackPublicPath;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fixed

Fixed webpack publicPath issue for Social admin.
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,7 @@ public static function get_urls() {

$urls = array(
'connectionsManagementPage' => self::publicize()->publicize_connections_url(),
'webpackPublicPath' => plugins_url( '/build/', __DIR__ ),
);

// Escape the URLs.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: bugfix

Fixed webpack publicPath issue for Social admin.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fixed

Fixed webpack publicPath issue for Social admin.
Loading