Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get request variables from query instead of request. #12002

Merged
merged 1 commit into from Mar 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions app/bundles/EmailBundle/Controller/AjaxController.php
Expand Up @@ -120,7 +120,7 @@
*/
protected function getAttachmentsSizeAction(Request $request)
{
$assets = $request->get('assets', [], true);
$assets = $request->query->get('assets', []);

Check warning on line 123 in app/bundles/EmailBundle/Controller/AjaxController.php

View check run for this annotation

Codecov / codecov/patch

app/bundles/EmailBundle/Controller/AjaxController.php#L123

Added line #L123 was not covered by tests
$size = 0;
if ($assets) {
/** @var \Mautic\AssetBundle\Model\AssetModel $assetModel */
Expand Down Expand Up @@ -287,8 +287,8 @@
/** @var EmailModel $model */
$model = $this->getModel('email');

$id = $request->get('id');
$ids = $request->get('ids');
$id = $request->query->get('id');
$ids = $request->query->get('ids');

// Support for legacy calls
if (!$ids && $id) {
Expand Down
Expand Up @@ -55,7 +55,7 @@ public function testPendingCountWithDeletedContactsInEmailStats(): void
$this->em->flush();

// The counts are loaded via ajax call after the email list page loads, so checking the ajax request instead of the HTML.
$this->client->request(Request::METHOD_POST, '/s/ajax?action=email:getEmailCountStats', ['id' => $email->getId()]);
$this->client->request(Request::METHOD_GET, '/s/ajax?action=email:getEmailCountStats', ['id' => $email->getId()]);

Assert::assertSame(
'{"id":'.$email->getId().',"pending":"1 Pending","queued":0,"sentCount":"0 Sent","readCount":"0 Read","readPercent":"0% Read"}',
Expand Down
12 changes: 6 additions & 6 deletions app/bundles/LeadBundle/Controller/AjaxController.php
Expand Up @@ -55,9 +55,9 @@
*/
protected function getLeadIdsByFieldValueAction(Request $request)
{
$field = InputHelper::clean($request->request->get('field'));
$value = InputHelper::clean($request->request->get('value'));
$ignore = (int) $request->request->get('ignore');
$field = InputHelper::clean($request->query->get('field'));
$value = InputHelper::clean($request->query->get('value'));
$ignore = (int) $request->query->get('ignore');

Check warning on line 60 in app/bundles/LeadBundle/Controller/AjaxController.php

View check run for this annotation

Codecov / codecov/patch

app/bundles/LeadBundle/Controller/AjaxController.php#L58-L60

Added lines #L58 - L60 were not covered by tests
$dataArray = ['items' => []];

if ($field && $value) {
Expand Down Expand Up @@ -649,7 +649,7 @@
protected function getEmailTemplateAction(Request $request)
{
$data = ['success' => 1, 'body' => '', 'subject' => ''];
$emailId = $request->get('template');
$emailId = $request->query->get('template');

Check warning on line 652 in app/bundles/LeadBundle/Controller/AjaxController.php

View check run for this annotation

Codecov / codecov/patch

app/bundles/LeadBundle/Controller/AjaxController.php#L652

Added line #L652 was not covered by tests

/** @var \Mautic\EmailBundle\Model\EmailModel $model */
$model = $this->getModel('email');
Expand Down Expand Up @@ -932,8 +932,8 @@

protected function getCampaignShareStatsAction(Request $request)
{
$ids = $request->get('ids');
$entityid = $request->get('entityId');
$ids = $request->query->get('ids');
$entityid = $request->query->get('entityId');

Check warning on line 936 in app/bundles/LeadBundle/Controller/AjaxController.php

View check run for this annotation

Codecov / codecov/patch

app/bundles/LeadBundle/Controller/AjaxController.php#L935-L936

Added lines #L935 - L936 were not covered by tests
/** @var SegmentCampaignShare $segmentCampaignShareService */
$segmentCampaignShareService = $this->get('mautic.lead.segment.stat.campaign.share');

Expand Down
12 changes: 6 additions & 6 deletions app/bundles/PluginBundle/Controller/AjaxController.php
Expand Up @@ -123,8 +123,8 @@
*/
protected function getIntegrationConfigAction(Request $request)
{
$integration = $request->request->get('integration');
$settings = $request->request->get('settings');
$integration = $request->query->get('integration');
$settings = $request->query->get('settings');

Check warning on line 127 in app/bundles/PluginBundle/Controller/AjaxController.php

View check run for this annotation

Codecov / codecov/patch

app/bundles/PluginBundle/Controller/AjaxController.php#L126-L127

Added lines #L126 - L127 were not covered by tests
$dataArray = ['success' => 0];

if (!empty($integration) && !empty($settings)) {
Expand Down Expand Up @@ -180,9 +180,9 @@

protected function getIntegrationCampaignStatusAction(Request $request)
{
$integration = $request->request->get('integration');
$campaign = $request->request->get('campaign');
$settings = $request->request->get('settings');
$integration = $request->query->get('integration');
$campaign = $request->query->get('campaign');
$settings = $request->query->get('settings');

Check warning on line 185 in app/bundles/PluginBundle/Controller/AjaxController.php

View check run for this annotation

Codecov / codecov/patch

app/bundles/PluginBundle/Controller/AjaxController.php#L183-L185

Added lines #L183 - L185 were not covered by tests
$dataArray = ['success' => 0];
$statusData = [];
if (!empty($integration) && !empty($campaign)) {
Expand Down Expand Up @@ -240,7 +240,7 @@
*/
protected function getIntegrationCampaignsAction(Request $request)
{
$integration = $request->request->get('integration');
$integration = $request->query->get('integration');

Check warning on line 243 in app/bundles/PluginBundle/Controller/AjaxController.php

View check run for this annotation

Codecov / codecov/patch

app/bundles/PluginBundle/Controller/AjaxController.php#L243

Added line #L243 was not covered by tests
$dataArray = ['success' => 0];

if (!empty($integration)) {
Expand Down