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

Loader::get_assets_context() throws a fatal error if get_current_screen returns null #918

Closed
raphcollective opened this issue Sep 2, 2020 · 0 comments
Labels
good first issue Feel free to contribute a PR to resolve issues like this one.

Comments

@raphcollective
Copy link

raphcollective commented Sep 2, 2020

Version

  • Carbon Fields: 3.1
  • WordPress: 5.5
  • PHP: 7.4

Issue

Loader::get_assets_context() assumes that get_current_screen return value is never null. get_current_screen can return a null value and because is_block_editor() is called directly, it results in the function throwing a fatal error.

It creates incompatibilities with the TD Composer plugin (for the theme Newspaper).

This can be easily solved by verifying the return of get_current_screen and returning 'classic' by default if it returns null.

@jorostoyanov jorostoyanov added the good first issue Feel free to contribute a PR to resolve issues like this one. label Nov 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Feel free to contribute a PR to resolve issues like this one.
Projects
None yet
Development

No branches or pull requests

2 participants