Automattic / newspack-popups

Popup notifications.
GNU General Public License v2.0
70 stars 17 forks source link

fix: prevent prompt expiration with invalid expiration date #1318

Closed adekbadek closed 1 month ago

adekbadek commented 1 month ago

All Submissions:

Changes proposed in this Pull Request:

Fixes a regression introduced in https://github.com/Automattic/newspack-popups/pull/1305. For some reason, some posts did get expiration_date with empty value assigned. Unfortunately, there's no way to fix these (re-publish), since we can't know which prompts were supposed to be published or not in the first place.

How to test the changes in this Pull Request:

  1. On release, assign empty value to a published prompt expiration_date meta
  2. Run wp cron event run newspack_popups_check_expiry, observe the prompt has been reverted to draft
  3. Switch to this branch, repeat, observe the prompt with invalid expiration_date is not reverted to draft

Other information:


matticbot commented 1 month ago

:tada: This PR is included in version 2.33.1 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket: