Skip to content

Conversation

@kwight
Copy link
Contributor

@kwight kwight commented Jul 16, 2020

The Premium Content block causes log errors by calling a non-static method statically to get tokens. This PR corrects the code usage to avoid the errors.

Discovered by @blackjackkent while testing #44192 .

87706667-84b06b00-c765-11ea-86e6-bedd9764b079

Testing Instructions

  • Set up a JN test site that is connected to WP.com and has a JP Premium plan attached.
  • Sandbox the store and API. Set the JN site to use the sandboxed API (WP Admin > Settings > Jetpack Constants).
  • 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 open the front-end of the post in an incognito window.
  • Subscribe to the content, using the test store card credentials to purchase.
  • The page will reload to show the now-accessible content; Verify it loads without the above errors.

@matticbot
Copy link
Contributor

@kwight kwight changed the title Premium Content: Correct "non-static method" errors. Premium Content: Correct "non-static method call" errors. Jul 16, 2020
@kwight kwight requested a review from a team July 16, 2020 22:14
@kwight kwight self-assigned this Jul 16, 2020
@kwight kwight added Premium Content Controlling specific content for paying site visitors. [Pri] Normal Schedule for the next available opportuinity. [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. [Type] Bug When a feature is broken and / or not performing as intended labels Jul 16, 2020
@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.

@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.

D46534-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

@kwight
Copy link
Contributor Author

kwight commented Jul 16, 2020

This still leaves the "header information" issues:

Screen Shot 2020-07-16 at 4 11 32 PM

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.

Thanks @kwight I verified that this ties the non-static method call, and that the premium content block still behaves as expected when subscribing.

@gwwar
Copy link
Contributor

gwwar commented Jul 17, 2020

Going to help land to help clear up the team board.

@gwwar gwwar merged commit e0c6fd5 into master Jul 17, 2020
@gwwar gwwar deleted the fix/pc-jp-warnings branch July 17, 2020 20:14
@matticbot matticbot removed the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Jul 17, 2020
@deBhal deBhal mentioned this pull request Jul 20, 2020
31 tasks
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. [Pri] Normal Schedule for the next available opportuinity. [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.

4 participants