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

Social Link: Fix server-side rendering for legacy format #20074

Merged
merged 1 commit into from
Feb 7, 2020

Conversation

mcsf
Copy link
Contributor

@mcsf mcsf commented Feb 6, 2020

Fixes a regression introduced in #19887.

While changing the logic in register_block_core_social_link to consume the block type's block.json and switch to the $service attribute name, I broke the handling of the legacy format for social links.

Old format: <!-- wp:social-link-wordpress {"url":"foo"} /-->
New format: <!-- wp:social-link {"service":"wordpress","url":"foo"} /-->

This fixes the handling of legacy social links by providing the adequate attribute default for each $service.

How has this been tested?

Make sure both new and old formats of social links are correctly rendered in the front-end.

Screenshots

Types of changes

Bug fix

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.
  • I've updated all React Native files affected by any refactorings/renamings in this PR.

Fixes a regression introduced in #19887.

While changing the logic in `register_block_core_social_link` to consume
the block type's `block.json` and switch to the `$service` attribute
name, I broke the handling of the legacy format for social links.

Old format: <!-- wp:social-link-wordpress {"url":"foo"} /-->
New format: <!-- wp:social-link {"service":"wordpress","url":"foo"} /-->

This fixes the handling of legacy social links by providing the adequate
attribute default for each `$service`.
@mcsf mcsf added [Type] Bug An existing feature does not function as intended Backwards Compatibility Issues or PRs that impact backwards compatability [Block] Social Affects the Social Block - used to display Social Media accounts labels Feb 6, 2020
@mcsf mcsf requested review from mkaz and gziolo February 6, 2020 18:14
@gziolo gziolo merged commit bf3042f into master Feb 7, 2020
@gziolo gziolo deleted the fix/social-link-render-backcompat branch February 7, 2020 07:25
@github-actions github-actions bot added this to the Gutenberg 7.5 milestone Feb 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Backwards Compatibility Issues or PRs that impact backwards compatability [Block] Social Affects the Social Block - used to display Social Media accounts [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants