GravityPDF / gravity-pdf

Gravity PDF is a GPLv2-licensed WordPress plugin that allows you to automatically generate, email and download PDF documents using Gravity Forms.
https://gravitypdf.com
89 stars 21 forks source link

Disable Queue Task when Gravity Forms Async Notifications is enabled. #1449

Closed jestonihpi closed 4 weeks ago

jestonihpi commented 1 year ago

Prior to Gravity Form 2.6.9 release which introduced this new filter gform_is_asynchronous_notifications_enabled. We need to check its value when getting the queued task on form. If this is set to true we need to disable queued PDFs and notifications as well.

Missing Unit Test

Description

Controller_Pdf_Queue class get_queuet_tasks method : get the value of the filter gform_is_asynchronous_notifications_enabled return $queue_data asap if its true

1444

Testing instructions

Screenshots

Checklist:

Additional Comments

codecov[bot] commented 1 year ago

Codecov Report

Attention: Patch coverage is 77.92208% with 17 lines in your changes missing coverage. Please review.

Project coverage is 76.03%. Comparing base (32c45cc) to head (262c5e3). Report is 1 commits behind head on development.

Files Patch % Lines
src/Statics/Queue_Callbacks.php 11.11% 8 Missing :warning:
src/Model/Model_PDF.php 79.16% 5 Missing :warning:
src/Controller/Controller_Pdf_Queue.php 90.90% 4 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## development #1449 +/- ## =============================================== - Coverage 76.03% 76.03% -0.01% =============================================== Files 248 248 Lines 12938 12949 +11 Branches 370 370 =============================================== + Hits 9838 9846 +8 - Misses 3092 3095 +3 Partials 8 8 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

jestonihpi commented 1 year ago

@jakejackson1 , can you take peek at this PR when you're available. I tried working on the approach you've mentioned on the initial meeting. I was unable work my way around it.

Not sure how to properly set the unit test for this 🤔