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

The site is not working #14547

Closed
nedalco1 opened this issue Mar 21, 2019 · 12 comments · Fixed by #14558
Closed

The site is not working #14547

nedalco1 opened this issue Mar 21, 2019 · 12 comments · Fixed by #14558
Labels
Needs Testing Needs further testing to be confirmed.

Comments

@nedalco1
Copy link

After the new update
The site is not working
I use WordPress 5.1.1
Waiting for update

@nedalco1
Copy link
Author

The site only works when the add-on is disabled

@youknowriad
Copy link
Contributor

Hi there! which add on are you talking about?
Can we have more details on the failure?

@youknowriad youknowriad added the [Status] Needs More Info Follow-up required in order to be actionable. label Mar 21, 2019
@nedalco1
Copy link
Author

nedalco1 commented Mar 21, 2019

When i update the add-on today
The site stopped working
Then I sent the technical support to the host
They told me the problem with this addition
Their words are true
When I've disabled the add-on
The site returned to work
See some of the conversation
https://a.top4top.net/p_1175h11hb1.jpg

@nedalco1
Copy link
Author

Please I want a solution
My business is now parked

@youknowriad
Copy link
Contributor

Can you share more details about the error, unfortunately, without these, there's no way for us to reproduce the error or know why you're having a failure.

@nedalco1
Copy link
Author

The problem has been resolved
By going back to the previous version
Apparently there is a sufferer of the problem
https://wordpress.org/support/topic/site-down-due-to-gutenberg-update-in-wp/

@youknowriad
Copy link
Contributor

Thanks for the link, we'll take a look.

@youknowriad youknowriad added Needs Testing Needs further testing to be confirmed. and removed [Status] Needs More Info Follow-up required in order to be actionable. labels Mar 21, 2019
@youknowriad
Copy link
Contributor

It looks like there's a plugin called envira-gallery that is using a deprecated function in Gutenberg. This function is still supposed to work for two more versions though. @aduth thoughts?

@aduth
Copy link
Member

aduth commented Mar 21, 2019

The error appears to occur from this line in the now-deprecated is_gutenberg_page:

gutenberg/gutenberg.php

Lines 92 to 97 in 98a19b6

function is_gutenberg_page() {
_deprecated_function( __FUNCTION__, '5.3.0', 'WP_Screen::is_block_editor' );
require_once ABSPATH . 'wp-admin/includes/screen.php';
return get_current_screen()->is_block_editor();
}

I've encountered issues before where get_current_screen was not a defined value, where the require_once in the preceding line is intended to ensure the function is available.

Looking closer at its implementation however, it seems there may be cases (presumably in non-wp-admin contexts) where it would return null, thus prompting the error seen above.

https://github.com/WordPress/wordpress-develop/blob/49d8c2590c73c283576c9864cd69973f7f1421b8/src/wp-admin/includes/screen.php#L213-L230

From this, I'd consider the following action items:

  • Within the plugin, any time we call get_current_screen, we should anticipate that it may return null. For the specific implementation of is_gutenberg_page, I'd suggest the following revision:
$screen = get_current_screen();
return ! is_null( $screen ) && $screen->is_block_editor();
  • For plugins generally, they should move away from the (now-deprecated) is_gutenberg_page. However, noting all of the above, while the recommendation would be to use WP_Screen::is_block_editor, the above two caveats should be noted that (a) get_current_screen may not be defined and (b) if defined, it may return null.

I could not verify this against envira-gallery since the plugin repository only contains a "lite" version. The lite version does not contain a reference to is_gutenberg_page, and in my limited testing works as expected without any errors.

cc @chrisakelley

@aduth
Copy link
Member

aduth commented Mar 21, 2019

Pull request at #14558.

@chrisakelley
Copy link

@aduth I just pushed an update to Envira Gallery Pro that should resolve it from our side.

@aduth
Copy link
Member

aduth commented Mar 21, 2019

Thanks for checking in @chrisakelley , and apologies for any trouble caused! I'd still like to see this solved on Gutenberg's end, even if the functions are slated for removal in a few versions' time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Testing Needs further testing to be confirmed.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants