Skip to content

Conversation

@kwight
Copy link
Contributor

@kwight kwight commented Jul 15, 2020

Starting with WordPress/gutenberg#22686, the PHP register_block_type block arguments for context and providesContext were deprecated (replaced by uses_context and provides_context respectively). This PR updates the usage to quiet the doing_it_wrong() errors.

Screen Shot 2020-07-15 at 4 27 36 PM

Testing Instructions

  • Set up a JN test site that is connected to WP.com and has a JP Premium plan attached.
  • Install the latest Gutenberg plugin.
  • Use the build artifact from the FSE plugin / Build FSE plugin (pull_request) task below as a ZIP plugin that you can upload to the test site.
  • Create a post, and add a Premium Content block for testing.
  • Save the post, and check the front-end of the post: the above errors should not display.

@matticbot
Copy link
Contributor

@kwight kwight requested a review from a team July 15, 2020 23:28
@kwight kwight self-assigned this Jul 15, 2020
@kwight kwight added [Type] Bug When a feature is broken and / or not performing as intended Premium Content Controlling specific content for paying site visitors. labels Jul 15, 2020
@matticbot
Copy link
Contributor

Caution: This PR affects files in the FSE Plugin on WordPress.com
Please ensure your changes work on WordPress.com before merging.

D46453-code has been created so you can easily test it on your sandbox. See this FieldGuide page about developing in the FSE Plugin for more info: PCYsg-ly5-p2

@matticbot
Copy link
Contributor

This PR does not affect the size of JS and CSS bundles shipped to the user's browser.

Generated by performance advisor bot at iscalypsofastyet.com.

@blackjackkent
Copy link
Contributor

Tested this in JN and am seeing a PHP error when viewing the Premium Content widget as a subscriber - however, it's a different error than the one in your screenshot:

Screen Shot 2020-07-16 at 1 08 40 PM

Deprecated: Non-static method Automattic\Jetpack\Connection\Manager::get_access_token() should not be called statically in /srv/users/user824aad5a/apps/user824aad5a/public/wp-content/plugins/fse-build-archive/premium-content/subscription-service/class-jetpack-token-subscription-service.php on line 35

I'm not sure if this is directly connected to your fix or not.

Copy link
Contributor

@gwwar gwwar left a comment

Choose a reason for hiding this comment

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

You're right, @blackjackkent it looks like we have other warnings to tidy, but we can fix those in follow up PRs.

@kwight I verified that the context warnings no longer appear in Gutenberg 8.3 and 8.5.1

@kwight kwight merged commit 5a48e03 into master Jul 16, 2020
@kwight kwight deleted the fix/premium-content-deprecations branch July 16, 2020 21:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Premium Content Controlling specific content for paying site visitors. [Type] Bug When a feature is broken and / or not performing as intended

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants