diff --git a/lib/API/JSON/v1/Forms.php b/lib/API/JSON/v1/Forms.php index 14133da45a..c8467b35d9 100644 --- a/lib/API/JSON/v1/Forms.php +++ b/lib/API/JSON/v1/Forms.php @@ -113,6 +113,10 @@ class Forms extends APIEndpoint { $form->setStatus($status); $this->formsRepository->flush(); + if ($status === FormEntity::STATUS_ENABLED) { + $this->wp->deleteTransient(DisplayFormInWPContent::NO_FORM_TRANSIENT_KEY); + } + $form = $this->formsRepository->findOneById($id); if (!$form instanceof FormEntity) return $this->errorResponse(); return $this->successResponse( @@ -200,7 +204,8 @@ class Forms extends APIEndpoint { } } - WPFunctions::get()->deleteTransient(DisplayFormInWPContent::NO_FORM_TRANSIENT_KEY); + // Reset no form cache + $this->wp->deleteTransient(DisplayFormInWPContent::NO_FORM_TRANSIENT_KEY); // check if the user gets to pick his own lists // or if it's selected by the admin