Skip to content

Commit

Permalink
Refactor: make designId nullable on confirmation receipt (#7000)
Browse files Browse the repository at this point in the history
Co-authored-by: Jon Waldstein <jonwaldstein@jons-air.mynetworksettings.com>
  • Loading branch information
jonwaldstein and Jon Waldstein authored Oct 9, 2023
1 parent d8ba2b5 commit f8bfaaf
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,7 @@ public function render(): string

$this->enqueueGlobalStyles($primaryColor, $secondaryColor);

$this->enqueueFormScripts(
$this->donation->formId,
$formDesignId
);
$this->enqueueFormScripts($formDesignId);

ob_start();
wp_print_styles();
Expand Down Expand Up @@ -166,7 +163,7 @@ public function enqueueGlobalStyles(string $primaryColor, string $secondaryColor
*
* @return void
*/
private function enqueueFormScripts(int $formId, string $formDesignId)
private function enqueueFormScripts(?string $formDesignId)
{
$handle = 'givewp-donation-form-registrars';
wp_enqueue_script(
Expand Down Expand Up @@ -196,7 +193,7 @@ private function enqueueFormScripts(int $formId, string $formDesignId)
$formDesignRegistrar = give(FormDesignRegistrar::class);

// silently fail if design is missing for some reason
if ($formDesignRegistrar->hasDesign($formDesignId)) {
if (!empty($formDesignId) && $formDesignRegistrar->hasDesign($formDesignId)) {
$design = $formDesignRegistrar->getDesign($formDesignId);

if ($design->css()) {
Expand Down

0 comments on commit f8bfaaf

Please sign in to comment.