Skip to content
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

Social | Fix publicize crashing when activated from the editor #40375

Closed
Closed
Show file tree
Hide file tree
Changes from 1 commit
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

Social | Fixed publicize crashing when activated in the editor
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public static function get_admin_script_data() {
}

$basic_data = array(
'api_paths' => array(),
'api_paths' => self::get_api_paths(),
'is_publicize_enabled' => Utils::is_publicize_active(),
'feature_flags' => self::get_feature_flags(),
'supported_services' => array(),
Expand All @@ -114,7 +114,6 @@ public static function get_admin_script_data() {
return array_merge(
$basic_data,
array(
'api_paths' => self::get_api_paths(),
'supported_services' => self::get_supported_services(),
'shares_data' => self::get_shares_data(),
'urls' => self::get_urls(),
Expand Down
4 changes: 0 additions & 4 deletions projects/packages/publicize/src/class-publicize-utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,6 @@ public static function should_block_editor_have_social() {
return false;
}

if ( ! self::is_publicize_active() ) {
return false;
}

$post_type = get_post_type();

if ( empty( $post_type ) || ! post_type_supports( $post_type, 'publicize' ) ) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: bugfix

Social | Fixed publicize crashing when activated in the editor
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fixed

Fixed publicize crashing when activated in the editor
5 changes: 5 additions & 0 deletions projects/plugins/social/src/class-jetpack-social.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
use Automattic\Jetpack\Modules;
use Automattic\Jetpack\My_Jetpack\Initializer as My_Jetpack_Initializer;
use Automattic\Jetpack\Publicize\Jetpack_Social_Settings\Dismissed_Notices;
use Automattic\Jetpack\Publicize\Publicize_Utils;
use Automattic\Jetpack\Status;
use Automattic\Jetpack\Terms_Of_Service;
use Automattic\Jetpack\Tracking;
Expand Down Expand Up @@ -224,6 +225,10 @@ public function get_shares_info() {
* @return array
*/
public function set_social_admin_script_data( $data ) {
// We need this data only on the social settings page.
if ( ! Publicize_Utils::is_social_settings_page() ) {
return $data;
}

$data['plugin_info']['social'] = array(
'version' => $this->get_plugin_version(),
Expand Down
Loading