Skip to content

Commit

Permalink
Merge pull request #12042 from nick-vanpraet/backport/subrequests-inc…
Browse files Browse the repository at this point in the history
…orrect-domain

AJAX requests use the site_url instead of the current domain [backport]
  • Loading branch information
escopecz committed Jun 2, 2023
2 parents aa4f8b6 + 9805b00 commit 74ce8d7
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 2 deletions.
Expand Up @@ -47,5 +47,6 @@ public function testDetailsPageLoadCorrectly(): void
$response = $this->client->getResponse();
Assert::assertSame(200, $response->getStatusCode());
Assert::assertStringContainsString($campaign->getName(), $response->getContent());
Assert::assertStringContainsString(sprintf('data-target-url="/s/campaigns/view/%s/contact/1"', $campaign->getId()), $response->getContent());
}
}
2 changes: 1 addition & 1 deletion app/bundles/CampaignBundle/Views/Campaign/details.html.php
Expand Up @@ -232,7 +232,7 @@ class="caret"></span> <?php echo $view['translator']->trans('mautic.core.details
<?php endif; ?>
<!--/ #events-container -->
<div class="tab-pane fade in bdr-w-0 page-list" id="leads-container" data-target-url="<?php
echo $view['router']->url(
echo $view['router']->path(
'mautic_campaign_contacts',
['objectId' => $campaign->getId(), 'page' => $app->getSession()->get('mautic.campaign.contact.page', 1)]
);
Expand Down
Expand Up @@ -78,6 +78,8 @@ public function testSegmentView(): void
//Make sure that contact grid is not loaded synchronously
self::assertStringNotContainsString('Kane', $response->getContent());
self::assertStringNotContainsString('Jacques', $response->getContent());
//Make sure the data-target-url is not an absolute URL
self::assertStringContainsString(sprintf('data-target-url="/s/segment/view/%s/contact/1"', $segment->getId()), $response->getContent());
}

public function testSegmentContactGrid(): void
Expand Down
2 changes: 1 addition & 1 deletion app/bundles/LeadBundle/Views/List/details.html.php
Expand Up @@ -169,7 +169,7 @@
<!-- start: tab-content -->
<div class="tab-content pa-md">
<div class="tab-pane active bdr-w-0 page-list" id="contacts-container" data-target-url="<?php
echo $view['router']->url(
echo $view['router']->path(
'mautic_segment_contacts',
['objectId' => $list->getId(), 'page' => $app->getSession()->get('mautic.segment.contact.page', 1)]
);
Expand Down

0 comments on commit 74ce8d7

Please sign in to comment.