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

Undefined index in class.jetpack-sync-functions.php #8137

Closed
richardmtl opened this issue Nov 9, 2017 · 5 comments · Fixed by #8367 or #8143
Closed

Undefined index in class.jetpack-sync-functions.php #8137

richardmtl opened this issue Nov 9, 2017 · 5 comments · Fixed by #8367 or #8143
Labels
[Package] Sync [Pri] Normal [Type] Bug When a feature is broken and / or not performing as intended

Comments

@richardmtl
Copy link
Contributor

First reported in a forum thread: https://wordpress.org/support/topic/notice-undefined-index-48/

Only in the administration area – Intermittent error:
Notice: Undefined index: scheme in /xxxxxx/plugins/jetpack/sync/class.jetpack-sync-functions.php on line 210

apache.error.log :
PHP Notice: Undefined index: scheme in /xxx/plugins/jetpack/sync/class.jetpack-sync-functions.php on line 210\n', referer: https://xxxx/wp-admin/post.php?post=xxxxx&action=edit
PHP Notice: Undefined index: scheme in /xxx/plugins/jetpack/sync/class.jetpack-sync-functions.php on line 210\n', referer: https://xxx/wp-admin/post-new.php

@richardmtl richardmtl added Admin Page React-powered dashboard under the Jetpack menu [Pri] High [Type] Bug When a feature is broken and / or not performing as intended labels Nov 9, 2017
@Umangvaghela
Copy link
Contributor

Hello @richardmtl

I send the PR to resolve the issue so please review it when you get a time and provide your feedback for the same.
Thanks

@jeherve jeherve added [Package] Sync [Pri] Normal and removed Admin Page React-powered dashboard under the Jetpack menu [Pri] High labels Nov 10, 2017
@StefMattana
Copy link

StefMattana commented Dec 15, 2017

Reopening as the same user reported a similar apache error log here:

PHP message: PHP Notice: Trying to get property of non-object in xxxxxx/wp-content/plugins/jetpack/sync/class.jetpack-sync-module-posts.php on line 204\n’, referer: xxxx/…/wp-admin/post.php?post=xxxxx&action=edit

Asking them to update to the 5.6.1 to see if something changes, just to stay on the safe side :)

@StefMattana StefMattana reopened this Dec 15, 2017
@Umangvaghela
Copy link
Contributor

@StefMattana

Hello Mam,

Issue is still happen by

function is_post_type_allowed( $post_id ) {
		$post = get_post( $post_id );

		return ! in_array( $post->post_type, Jetpack_Sync_Settings::get_setting( 'post_types_blacklist' ) );
}

@jeherve

Hello Sir

If we update the code so we will overcome the problem.
My solution.

function is_post_type_allowed( $post_id ) {
		$post = get_post(intval( $post_id) );
                if( $post->post_type ) { 
                  		return ! in_array( $post->post_type, Jetpack_Sync_Settings::get_setting( 'post_types_blacklist' ); 
                } 
                return false;
}

Thanks

@StefMattana
Copy link

StefMattana commented Dec 16, 2017

@oskosk
Copy link
Contributor

oskosk commented Feb 14, 2018

Looks like the original issue was fixed by #8143. The issue reported in #8137 (comment) was fixed by #8367

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Sync [Pri] Normal [Type] Bug When a feature is broken and / or not performing as intended
Projects
None yet
5 participants