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

Facebook Widget: Fix URL error when adding widget #20864

Merged
merged 2 commits into from
Aug 30, 2021

Conversation

kbrown9
Copy link
Member

@kbrown9 kbrown9 commented Aug 27, 2021

Fixes #20836

Changes proposed in this Pull Request:

  • Add the keys from the $new_instance array to the top level of the array returned
    by the update method. This allows the widget to be updated from wp-admin/widgets.php.
  • In the widget method, set the $like_args value to the default values, and only set the
    variable to the instance values if they exist. This prevents a PHP notice from being
    generated when the like_args key doesn't exist.

Jetpack product discussion

  • n/a

Does this pull request change what data or activity we track or use?

  • no

Testing instructions:

These changes need to be tested in the following situations:

  • The widget is added/changed on the wp-admin/widgets.php page.
  • The widget is added/changed on the wp-admin/customize.php page.
  • The widget is added/changed using the new widget block editor.
  • The widget is added/changed using the classic widget editor.
Set up the test site
  1. Install, activate, and connect this branch of Jetpack.
  2. Enable the Extra Sidebar Widgets module by navigating to wp-admin -> Jetpack -> Settings -> Writing. Turn on the Make extra widgets available for use on your site... setting.
Test with the widget block editor
  1. Navigate to Appearance -> Widgets.
  2. Add a Facebook Page widget and click update. The widget should display properly on both the Widgets page and on the site's front-end.
  3. Change the widget's settings (height, width, etc.) and verify that they are updated correctly.
  4. Navigate to Appearance -> Customize.
  5. Repeat Steps 4 and 5 in the Customizer. The Facebook Page widget should display properly in the Customizer and on the site's front-end.
Test with the classic widget editor
  1. Install and activate the Classic Widgets plugin.
  2. Repeat steps 3-7 with the classic widgets editor.

 * Add the keys from the $new_instance array to the top level of the array returned
   by the update method. This allows the widget to be updated from wp-admin/widgets.php.
 * In the widget method, set the $like_args value to the default values, and only set the
   variable to the instance values if they exist. This prevents a PHP notice from being
   generated when the like_args key doesn't exist.
@kbrown9 kbrown9 added [Type] Bug When a feature is broken and / or not performing as intended [Feature] Extra Sidebar Widgets [Status] In Progress labels Aug 27, 2021
@kbrown9 kbrown9 self-assigned this Aug 27, 2021
@matticbot
Copy link
Contributor

Caution: This PR has changes that must be merged to WordPress.com
Hello kbrown9! These changes need to be synced to WordPress.com - If you 're an a11n, please commandeer and confirm D66044-code works as expected before merging this PR. Once this PR is merged, please commit the changes to WP.com. Thank you!
This revision will be updated with each commit to this PR

@github-actions github-actions bot added the [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ label Aug 27, 2021
@github-actions
Copy link
Contributor

github-actions bot commented Aug 27, 2021

Thank you for your PR!

When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:

  • ✅ Include a description of your PR changes.
  • ✅ All commits were linted before commit.
  • ✅ Add a "[Status]" label (In Progress, Needs Team Review, ...).
  • ✅ Add testing instructions.
  • ✅ Specify whether this PR includes any changes to data or privacy.
  • ✅ Add changelog entries to affected projects

This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖


The e2e test report can be found here. Please note that it can take a few minutes after the e2e tests checks are complete for the report to be available.


Once your PR is ready for review, check one last time that all required checks (other than "Required review") appearing at the bottom of this PR are passing or skipped.
Then, add the "[Status] Needs Team review" label and ask someone from your team review the code.
Once you’ve done so, switch to the "[Status] Needs Review" label; someone from Jetpack Crew will then review this PR and merge it to be included in the next Jetpack release.


Jetpack plugin:

  • Next scheduled release: September 7, 2021.
  • Scheduled code freeze: August 30, 2021.

@kbrown9 kbrown9 added [Status] Needs Review To request a review from fellow Jetpack developers. Label will be renamed soon. and removed [Status] In Progress labels Aug 30, 2021
@kbrown9 kbrown9 added this to the jetpack/10.1 milestone Aug 30, 2021
Copy link
Contributor

@sdixon194 sdixon194 left a comment

Choose a reason for hiding this comment

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

This works for me! Widget could use some love for sure, but this fixes the issue.

Also, your testing instructions are the best 👍

@sdixon194 sdixon194 added [Status] Ready to Merge Go ahead, you can push that green button! and removed [Status] Needs Review To request a review from fellow Jetpack developers. Label will be renamed soon. labels Aug 30, 2021
@sdixon194 sdixon194 merged commit 3ce8ea7 into master Aug 30, 2021
@sdixon194 sdixon194 deleted the update/facebook_widget branch August 30, 2021 15:16
@github-actions github-actions bot removed the [Status] Ready to Merge Go ahead, you can push that green button! label Aug 30, 2021
@github-actions
Copy link
Contributor

Great news! One last step: head over to your WordPress.com diff, D66044-code, and commit it.
Once you've done so, come back to this PR and add a comment with your changeset ID.

Thank you!

davidlonjon added a commit that referenced this pull request Aug 31, 2021
* master: (34 commits)
  Fix issue templates (#20880)
  Social Icon Widget: Fix Icons Not Saving (#20862)
  Dashboard: Add a specific message for a site that is too new to have a rewind status (#20863)
  Add additional properties to WC Analytics events (#20812)
  Connection: add spinner for the "Connect" button (#20872)
  Update storybook monorepo to v6.3.7 (#20877)
  Lightweight PHPCS (#20876)
  Recommendations: Add Jetpack Product Suggestions step (#20814)
  Update babel monorepo (#20875)
  Update wordpress monorepo (#20873)
  cli: Check subprocess exit statuses in docker commands (#20861)
  Facebook Widget: Fix URL error when adding widget (#20864)
  Stats: make nudges collapsible (#20765)
  Remove temporary Newspack block override css (#20868)
  Allow ZIP uploads via Calypso (#20860)
  Sync Package Release v1.26.0 (#20870)
  Connection: remove in-place in secondary flows (#20739)
  BUILD_DIR -> BUILD_BASE in initial checks (#20857)
  E2E tests: Fix missing action for atomic workflow (#20866)
  Boost: Fix skip proxy origins to load css during critical CSS generation (#20793)
  ...
@kbrown9
Copy link
Member Author

kbrown9 commented Aug 31, 2021

Deployed to wpcom in r231011-wpcom.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Extra Sidebar Widgets [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ Touches WP.com Files [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.

Facebook Page Widget: Adding widget in Block Widget Editor results in error
3 participants