-
Notifications
You must be signed in to change notification settings - Fork 43
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
Explicitly declare global #34
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @pdewouters and thanks for the PR!
Can you give some more details about why you want to make this change?
- What exact conditions are used to create the error you show above, can you share your loading code?
- Have you considered other approaches?
- Could this change have unintended side effects?
@adamsilverstein yes here's where the plugin is loaded: https://github.com/humanmade/altis-cms/pull/111/files , we want to include it via composer, and then load it on the Other approach could be:
Instead of making it a super global with |
@pdewouters thanks for clarifying, i'll take a closer look and let you know what we can do here. |
@pdewouters - this looks good, i verified the issue and the fix. can you please change to your suggested
to better match the rest of the code |
Co-Authored-By: Adam Silverstein <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @pdewouters!
Thanks for merging @adamsilverstein , any plans for a new tagged release? |
@pdewouters per #51, we're looking to release 2.2.0 sometime in July. We've got 2 releases ahead of it on other open source projects, but hope to get to 2.2.0 soon. |
Description of the Change
Fixes an error related to variable scope
Uncaught Error: Call to a member function get_avatar() on null in /chassis/vendor/10up/simple-local-avatars/simple-local-avatars.php on line 580get_simple_local_avatar()vendor/10up/simple-local-avatars/simple-local-avatars.php:254edit_user_profile()wp-includes/class-wp-hook.php:286apply_filters()wp-includes/class-wp-hook.php:310do_action()wp-includes/plugin.php:465do_action()wp-admin/user-edit.php:700require_once()wp-admin/profile.php:18
Benefits
The plugin can be included via our loading mechanism
Possible Drawbacks
Verification Process
Checklist:
Applicable Issues
Changelog Entry
Initialize
Simple_Local_Avatars
on the$simple_local_avatars
global, enabling bundling plugin with composer.