Jetpack Donations Block: Plan IDs disappear

Impacted plugin

Jetpack

Steps to Reproduce

  1. Go to page with Donations Block as a logged in user that is not the Jetpack plan owner
  2. Edit any content on the page.
  3. Save the page.
  4. View page and test Donation block.

This error appears: Screenshot on 2021-11-30 at 11-11-26

A clear and concise description of what you expected to happen.

Any site user with admin/editing permissions should be able to go to a page with the donation block, edit content on the page, and publish the changes.

When viewing the updated page, the donation block should still function properly and accept transactions.

What actually happened

  • A non-Jetpack plan owner but admin to the site made a text update to a page.
  • Saving that somehow removed the plan IDs from the Jetpack donation block
  • Without the plan IDs the donation block won’t work
  • Logging in as the Jetpack plan owner, clicking on the Jetpack donation block, and then viewing the code view behind the blocks (in the block editor) showed that the plan IDs came back
  • Saving the page with the plan IDs back in the block made the block work again.

Missing Plan IDs

Markup 2021-11-30 at 11 09 01

Other information

Working Theory: Editing the page content as a different user from the Jetpack plan owner, for some reason, removes the Plan IDs for each of the donation amounts.

Plan IDs restored: Markup 2021-11-30 at 11 04 01

Operating System

macOS

OS Version

Catalina 10.15.7

Browser

Chrome/Chromium

Browser Version(s)

Version 96.0.4664.55

Asked Jan 08 '22 23:01
avatar dhanson-wp
dhanson-wp

2 Answer:

Yeah, I can reproduce this and seems to be the missing planID indeed and something that has been broken for a while in my testing:

Undefined index: planId in /srv/users/user5d76e790/apps/user5d76e790/public/wp-content/plugins/jetpack/extensions/blocks/donations/donations.php on line 143

@mmtr, I believe you worked on some donations block stuff somewhat recently. Would this be something we could take a look at?

1
Answered Dec 08 '21 at 19:46
avatar  of sdixon194
sdixon194

@sdixon194 I don't have enough availability at the moment, but I'm happy to take a look next week as part of my 20% time (see p9MPsk-1iY-p2#comment-12243). @obenland also suggested to include it as part of the first iteration of the Payment Blocks in 2022 (see p9MPsk-1iY-p2#comment-1225).

1
Answered Dec 09 '21 at 09:42
avatar  of mmtr
mmtr