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

Updating a copied "Pay with PayPal" block works like reusable blocks (affecting other references of the same block) #58446

Open
arunsathiya opened this issue Nov 24, 2021 · 16 comments
Labels
Customer Report Issues or PRs that were reported via Happiness. Previously known as "Happiness Request". Payments: Solved by Woo Payment blocks issues solved by transitioning to WooCommerce [Pri] Normal Schedule for the next available opportuinity. Triaged To be used when issues have been triaged. [Type] Bug

Comments

@arunsathiya
Copy link
Contributor

Quick summary

I can't figure a good title here, but I hope the summary explains the issue: editing a copy of the "Pay with PayPal" block makes the update to all previous copies of the same "Pay with PayPal" block. Editing a new "Pay with PayPal" block does not affect the others though.

Steps to reproduce

  • Start with a WordPress.com site on the WordPress.com Premium plan or higher: https://wordpress.com/support/pay-with-paypal/
  • Add a "Pay with PayPal" block to the page.
  • Copy the block.
  • Paste it on the same page. (Or just use Gutenberg's duplicate function)
  • Save changes to the page.
  • Edit one of the two blocks.
  • Save changes.
  • Refresh the page.
  • See that the update affects both "Pay with PayPal" blocks, while it must affect only the one that's edited.
  • Creating/editing a new "Pay with PayPal" block does not affect the previous copied versions though.

What you expected to happen

Editing a copied "Pay with PayPal" affects only that block, not the previous references of the same block.

What actually happened

All references are updated.

Context

Customer bug report: 4540958-zen.

Operating System

macOS

Browser

Mozilla Firefox

Simple, Atomic or both?

Simple, Atomic

Theme-specific issue?

No.

Other notes

No response

Reproducibility

Consistent

Severity

All

Available workarounds?

No but the platform is still usable

Workaround details

Workaround is to create the new "Pay with PayPal" block instead of duplicating an existing one.

@arunsathiya
Copy link
Contributor Author

Also posted here: pNPgK-5B3-p2 cc @inaikem

@DavidRothstein
Copy link
Contributor

I couldn't reproduce this myself (in general I found the content of the block didn't duplicate at all sometimes, but when it did -- maybe only after an autosave? -- it seemed to be two separate blocks, and editing the first block and saving didn't have any effect on the other).

I'm ccing @Automattic/view-engineering though, which I think still maintains these blocks.

@stacimc
Copy link
Contributor

stacimc commented Nov 30, 2021

👋 There's a jetpack issue tracking this: Automattic/jetpack#12801

The issue is that when you duplicate or copy a Pay With PayPal block, all of its attributes including the productId attribute get copied into the new block. The productId is internal to the block so this is not immediately apparent to a user, but consequently all changes to either block get posted to the same underlying product.

To fix this we need a change in Gutenberg to allow for preventing certain attributes from being copied on block duplication. I created an issue in Gutenberg and opened a PR for it here to do just that, which still needs community review.

@kosiew kosiew added the Triaged To be used when issues have been triaged. label Dec 1, 2021
@kosiew
Copy link

kosiew commented Dec 1, 2021

Marking as Triaged since it's already on Shilling's radar.

@cometgrrl cometgrrl added the [Pri] Normal Schedule for the next available opportuinity. label Dec 7, 2021
@artpi artpi added the Payments: Solved by Woo Payment blocks issues solved by transitioning to WooCommerce label Jan 6, 2022
@rinazrina
Copy link

rinazrina commented Jan 18, 2022

Another report here: 4695735-zen

@MaxPhilip
Copy link

MaxPhilip commented Feb 8, 2022

Another report in 4758262-zen / 4749729-zen

@davipontesblog
Copy link
Contributor

davipontesblog commented May 24, 2022

Another report in 5240302-zen

@cuemarie
Copy link

cuemarie commented Jul 1, 2022

Another report here: 35950266-hc

@Joshgrygiel
Copy link

Another report here: 36442397-hc

@github-actions
Copy link

github-actions bot commented Aug 12, 2022

Support References

This comment is automatically generated. Please do not edit it.

  • 4540958-zen
  • 4695735-zen
  • 4758262-zen
  • 4749729-zen
  • 5240302-zen
  • 5735863-zen
  • 5788907-zen
  • 6286760-zen
  • 9020583-zen

@mzitinfo
Copy link

This issue popped up again in 5735863-zen

@cecilearkay
Copy link

Another report in 22776651-hc

@MaxPhilip
Copy link

Another report in 5788907-zen

@zdenys
Copy link
Contributor

zdenys commented Mar 17, 2023

41694914-hc

@donalirl
Copy link

#6286760-zen

Perhaps the Duplicate and Copy block features should be disabled for Pay with PayPal?

@lailagmelo
Copy link

lailagmelo commented Nov 18, 2024

I was able to replicate the issue. Creating multiple blocks individually instead of duplicating is a valid workaround.

#9020583-zen

@github-actions github-actions bot added the Customer Report Issues or PRs that were reported via Happiness. Previously known as "Happiness Request". label Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Customer Report Issues or PRs that were reported via Happiness. Previously known as "Happiness Request". Payments: Solved by Woo Payment blocks issues solved by transitioning to WooCommerce [Pri] Normal Schedule for the next available opportuinity. Triaged To be used when issues have been triaged. [Type] Bug
Projects
None yet
Development

No branches or pull requests