Skip to content

Commit

Permalink
fix: broken tests
Browse files Browse the repository at this point in the history
  • Loading branch information
glaubersilva committed Nov 8, 2024
1 parent e27a1c4 commit 0bdfe43
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/DonationForms/V2/Endpoints/ListDonationForms.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,15 +136,15 @@ public function handleRequest(WP_REST_Request $request): WP_REST_Response
$this->listTable->items($forms, $this->request->get_param('locale') ?? '');
$items = $this->listTable->getItems();

$defaultCampaignForm = Campaign::find($this->request->get_param('campaignId'))->defaultForm();
$defaultCampaignForm = ($campaignId = $this->request->get_param('campaignId')) ? Campaign::find($campaignId)->defaultForm() : false;

foreach ($items as $i => &$item) {
$item['name'] = get_the_title($item['id']);
$item['edit'] = get_edit_post_link($item['id'], 'edit');
$item['permalink'] = get_permalink($item['id']);
$item['v3form'] = (bool)give_get_meta($item['id'], 'formBuilderSettings');
$item['status_raw'] = $forms[$i]->status->getValue();
$item['isDefaultCampaignForm'] = $item['id'] === $defaultCampaignForm->id;
$item['isDefaultCampaignForm'] = $defaultCampaignForm && $item['id'] === $defaultCampaignForm->id;
}
}

Expand Down

0 comments on commit 0bdfe43

Please sign in to comment.