Skip to content

Fix: PHP Notice#10094

Merged
enejb merged 1 commit intomasterfrom
fix/sync-user-cap-key-php-notice
Sep 5, 2018
Merged

Fix: PHP Notice#10094
enejb merged 1 commit intomasterfrom
fix/sync-user-cap-key-php-notice

Conversation

@enejb
Copy link
Copy Markdown
Member

@enejb enejb commented Sep 4, 2018

This PR fixes a PHP notice found in my error log>

In cases where get_user_by doesn't return a valid user object this PR supressed the followind php Notice.

[04-Sep-2018 20:23:06 UTC] PHP Notice:  Trying to get property of non-object in /var/www/html/wp-content/plugins/jetpack/sync/class.jetpack-sync-module-users.php on line 299
[04-Sep-2018 20:23:06 UTC] PHP Stack trace:
[04-Sep-2018 20:23:06 UTC] PHP   1. {main}() /var/www/html/wp-admin/themes.php:0
[04-Sep-2018 20:23:06 UTC] PHP   2. switch_theme($stylesheet = *uninitialized*) /var/www/html/wp-admin/themes.php:33
[04-Sep-2018 20:23:06 UTC] PHP   3. do_action($tag = *uninitialized*, $arg = *uninitialized*, *uninitialized*, *uninitialized*) /var/www/html/wp-includes/theme.php:753
[04-Sep-2018 20:23:06 UTC] PHP   4. WP_Hook->do_action($args = *uninitialized*) /var/www/html/wp-includes/plugin.php:453
[04-Sep-2018 20:23:06 UTC] PHP   5. WP_Hook->apply_filters($value = *uninitialized*, $args = *uninitialized*) /var/www/html/wp-includes/class-wp-hook.php:310
[04-Sep-2018 20:23:06 UTC] PHP   6. TGM_Plugin_Activation->update_dismiss(*uninitialized*) /var/www/html/wp-includes/class-wp-hook.php:288
[04-Sep-2018 20:23:06 UTC] PHP   7. delete_metadata($meta_type = *uninitialized*, $object_id = *uninitialized*, $meta_key = *uninitialized*, $meta_value = *uninitialized*, $delete_all = *uninitialized*) /var/www/html/wp-content/themes/influencer/inc/tgmpa/class-tgm-plugin-activation.php:1910
[04-Sep-2018 20:23:06 UTC] PHP   8. do_action($tag = *uninitialized*, $arg = *uninitialized*, *uninitialized*, *uninitialized*, *uninitialized*) /var/www/html/wp-includes/meta.php:433
[04-Sep-2018 20:23:06 UTC] PHP   9. WP_Hook->do_action($args = *uninitialized*) /var/www/html/wp-includes/plugin.php:453
[04-Sep-2018 20:23:06 UTC] PHP  10. WP_Hook->apply_filters($value = *uninitialized*, $args = *uninitialized*) /var/www/html/wp-includes/class-wp-hook.php:310
[04-Sep-2018 20:23:06 UTC] PHP  11. Jetpack_Sync_Module_Users->maybe_save_user_meta($meta_id = *uninitialized*, $user_id = *uninitialized*, $meta_key = *uninitialized*, $value = *uninitialized*) /var/www/html/wp-includes/class-wp-hook.php:286

Testing instructions:

I am not sure how to reproduce the error :(

Changes proposed in this Pull Request:

  • Fixes a PHP Notice found.

Proposed changelog entry for your changes:

Removes a PHP Notice

This PR fixes a PHP notice found in my error log>

In cases where get_user_by doesn't return a valid user object this PR supressed the followind php Notice.

[04-Sep-2018 20:23:06 UTC] PHP Notice:  Trying to get property of non-object in /var/www/html/wp-content/plugins/jetpack/sync/class.jetpack-sync-module-users.php on line 299
[04-Sep-2018 20:23:06 UTC] PHP Stack trace:
[04-Sep-2018 20:23:06 UTC] PHP   1. {main}() /var/www/html/wp-admin/themes.php:0
[04-Sep-2018 20:23:06 UTC] PHP   2. switch_theme($stylesheet = *uninitialized*) /var/www/html/wp-admin/themes.php:33
[04-Sep-2018 20:23:06 UTC] PHP   3. do_action($tag = *uninitialized*, $arg = *uninitialized*, *uninitialized*, *uninitialized*) /var/www/html/wp-includes/theme.php:753
[04-Sep-2018 20:23:06 UTC] PHP   4. WP_Hook->do_action($args = *uninitialized*) /var/www/html/wp-includes/plugin.php:453
[04-Sep-2018 20:23:06 UTC] PHP   5. WP_Hook->apply_filters($value = *uninitialized*, $args = *uninitialized*) /var/www/html/wp-includes/class-wp-hook.php:310
[04-Sep-2018 20:23:06 UTC] PHP   6. TGM_Plugin_Activation->update_dismiss(*uninitialized*) /var/www/html/wp-includes/class-wp-hook.php:288
[04-Sep-2018 20:23:06 UTC] PHP   7. delete_metadata($meta_type = *uninitialized*, $object_id = *uninitialized*, $meta_key = *uninitialized*, $meta_value = *uninitialized*, $delete_all = *uninitialized*) /var/www/html/wp-content/themes/influencer/inc/tgmpa/class-tgm-plugin-activation.php:1910
[04-Sep-2018 20:23:06 UTC] PHP   8. do_action($tag = *uninitialized*, $arg = *uninitialized*, *uninitialized*, *uninitialized*, *uninitialized*) /var/www/html/wp-includes/meta.php:433
[04-Sep-2018 20:23:06 UTC] PHP   9. WP_Hook->do_action($args = *uninitialized*) /var/www/html/wp-includes/plugin.php:453
[04-Sep-2018 20:23:06 UTC] PHP  10. WP_Hook->apply_filters($value = *uninitialized*, $args = *uninitialized*) /var/www/html/wp-includes/class-wp-hook.php:310
[04-Sep-2018 20:23:06 UTC] PHP  11. Jetpack_Sync_Module_Users->maybe_save_user_meta($meta_id = *uninitialized*, $user_id = *uninitialized*, $meta_key = *uninitialized*, $value = *uninitialized*) /var/www/html/wp-includes/class-wp-hook.php:286
@enejb enejb requested a review from a team as a code owner September 4, 2018 20:45
@matticbot
Copy link
Copy Markdown
Contributor

Caution: This PR has changes that must be merged to WordPress.com
Please review this diff before merging: D17927-code. (newly created revision)

@enejb enejb self-assigned this Sep 4, 2018
@enejb enejb requested review from gititon and lezama September 4, 2018 20:45
@enejb enejb added [Status] Needs Review This PR is ready for review. [Package] Sync labels Sep 4, 2018
@enejb enejb added this to the 6.6 milestone Sep 4, 2018
@jetpackbot
Copy link
Copy Markdown
Collaborator

That's a great PR description, thank you so much for your effort!

Generated by 🚫 dangerJS

Copy link
Copy Markdown
Member

@jeherve jeherve left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes sense. I can't reproduce the error right now, but I know that some role management plugins can sometimes mess things up like that from time.

LGTM!

@jeherve jeherve added [Status] Ready to Merge Go ahead, you can push that green button! and removed [Status] Needs Review This PR is ready for review. labels Sep 5, 2018
@enejb enejb merged commit 084eba1 into master Sep 5, 2018
@ghost ghost removed the [Status] Ready to Merge Go ahead, you can push that green button! label Sep 5, 2018
@enejb enejb deleted the fix/sync-user-cap-key-php-notice branch September 5, 2018 22:59
jeherve added a commit that referenced this pull request Sep 24, 2018
jeherve added a commit that referenced this pull request Sep 25, 2018
* Readme: add boilerplate for next release, 6.6

* Add 6.5 to the changelog.txt file

* Set boilerplate testing list for 6.6

* Readme: update stable tag to 6.5

* Add bullets to 6.5 changelog items

* Readme: add link to previous changelogs

This will help folks who want to know more about past releases,
while keeping the readme.txt short so as to not overwhelm translators and site owners only looking for information about the last release.

* Changelog: add information at the top of the changelog file.

* Changelog: add #10054

* Changelog: add #10078

* Changelog: add #10079

* Changelog: add #10064

* Changelog: add #10094

* Changelog: add #10096

* Testing list: add more information based on #10087

* Changelog: add #9847

* Changelog: add #10084

* Changelog: add #9918

* Changelog: add #7614

* Changelog: add #10116

* Changelog: add #10108

* Changelog: add #10041

* Changelog: add #10121

* Changelog: add #10134

* Changelog: add #10130

* Changelog: add #10109

* changelog: add #10137

* changelog: add #9952

* changelog: add #10120

* changelog: add #10162

* Changelog: add #10163

* Changelog: add #10092

* changelog: add #10156

* Changelog: add #10154

* changelog: add #10122

* Changelog: add #10101

* changelog: add #10105

* changelog: add #10190

* Changelog: add #10196

* changelog: add #10152

* Changelog: add #10153

* Testing list: add more details to Site Verification testing steps.

@see #10143 (comment)

* changelog: add #10194

* Changelog: add #10193
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants