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

4.1 -> 4.x #10789

Merged
merged 21 commits into from Jan 27, 2022
Merged

4.1 -> 4.x #10789

merged 21 commits into from Jan 27, 2022

Conversation

RCheesley
Copy link
Sponsor Member

@RCheesley RCheesley commented Jan 25, 2022

Q A
Bug fix? (use the a.b branch) Yes
Deprecations? No
BC breaks? (use the c.x branch) None

Description:

This PR merges the changes from 4.1.2 into the 4.x branch.

Steps to test this PR:

  1. Open this PR on Gitpod or pull down for testing locally (see docs on testing PRs here)
  2. Check that all is working as expected.

kathrin-schmid and others added 20 commits December 17, 2021 14:02
The button that i updated is for saving changes made in the "Edit code" window and should thus say "Save", not "Edit".
…mautic#10697)

* Fixes issue mautic#10453

* Adding functional test covering the bug

mautic#10453

Co-authored-by: Rolando <rpayanm@gmail.com>
* Deleted unused IPs in batches and some improvements.

* Added return type declaration to command methods and some improvements.

* Removed dump()

* Created separate methods for get and delete unused ips.

* Consumed repo methods in model.

* Updated command to use model methods.

* Added test case.

* Fix static analysis
Co-authored-by: John Linhart <admin@escope.cz>
…autic#10663)

Fix error when using PHP 8:
{"exception":"[object] (Symfony\\Component\\Debug\\Exception\\FatalThrowableError(code: 0): array_merge() does not accept unknown named parameters}

Not sure if this is the most elegant way to address the issue but this bug has broken the site functionality.
* Allow user to update role via API

* Update user's role using API: test cases

* Update user's role using API: added more test cases

* Fix test cases and add more test case

* Added AbstractMauticTestCase::loginUser() method that allows login user in non-restricted areas

* Fix failing tests

Co-authored-by: fedys <miroslav.fedeles@gmail.com>
Co-authored-by: John Linhart <admin@escope.cz>
* Fix send unpublished SMS

* Fix send unpublished SMS for broadcast command

* Add CampaignSendSubscriberTest

* Add testSendSmsNotPublished test

* Minor change to tests

* Fixing types

* Automatic cs fix

Co-authored-by: John Linhart <admin@escope.cz>
* Fix group by If you use count columns

* Add unit tests

* Fix unit tests

* Remove define from tests

* Fix unit tests

* Fix unit tests

* Fix unit tests

Co-authored-by: John Linhart <admin@escope.cz>
Removing the background color f0f0f0 from gjs-field-radio class to improve the color constrast between radio's background and radio's options and returning the class parameters to the default of the original editor.

Co-authored-by: Ruth Cheesley <ruth.cheesley@acquia.com>
Apply Stalebot only to issues and not PRs

Co-authored-by: John Linhart <admin@escope.cz>
Co-authored-by: Ruth Cheesley <ruth.cheesley@acquia.com>
Co-authored-by: Joey Keller <jos0405@gmail.com>
…ar (mautic#10778)

* Change field definition for column_value to longtext instead of varchar 255

* Update app/migrations/Version20200729170800.php

Co-authored-by: John Linhart <admin@escope.cz>

* I suggested bad namespace path during code review. Fixing it here

Co-authored-by: Don Gilbert <don@dongilbert.net>
…orms have identical names (mautic#10717)

* Correct name form Campaign Contact Source

* Refactoring and add test

* Finishing up the test

* Fixing the bug discovered by the test

* CS fix

Co-authored-by: John Linhart <admin@escope.cz>
Co-authored-by: Ruth Cheesley <ruth.cheesley@acquia.com>
* Fix empty value in contact boolean fields

* Fix configuration page save

* Fix controller functional tests

* Always retype the isEnabled param to int. Even for PATCH

* Fixing phpstan issue

  Line   app/bundles/ChannelBundle/Controller/Api/MessageApiController.php
 ------ -------------------------------------------------------------------
  32     Property
         Mautic\ChannelBundle\Controller\Api\MessageApiController::$model
         (Mautic\ChannelBundle\Model\MessageModel) does not accept
         Mautic\CoreBundle\Model\AbstractCommonModel.

* Fixing PHP Notice - Undefined index: email

"file":"\/var\/www\/html\/mautic\/app\/bundles\/ChannelBundle\/Controller\/Api\/MessageApiController.php","line":54

I cannot figure out why the condition for PATCH was there in the first place. It's causing only troubles.

* Adding functional API tests covering the problematic endpoint and method, fixing the controller

* Fix csfixer issue

* Adding missing description to payloads for assertion

Co-authored-by: John Linhart <admin@escope.cz>
Co-authored-by: Ruth Cheesley <ruth.cheesley@acquia.com>
* Add missing information

* Missing commas 😊
* Fix for mautic#10517

Some integrations such as Hubspot have an `'encode_parameters' => 'json'` setting, which triggers the parameters being sent in `POST` / `PUT` / `PATCH` requests to be `json_encode`-d: https://github.com/mautic/mautic/blob/5975231722cfde8bdad783b373c70ad20333db37/app/bundles/PluginBundle/Integration/AbstractIntegration.php#L760

That causes a problem when the result is passed to Guzzle's `request` method under key `\GuzzleHttp\RequestOptions::FORM_PARAMS`, because the payload is expected to be an array: https://github.com/mautic/mautic/blob/5975231722cfde8bdad783b373c70ad20333db37/app/bundles/PluginBundle/Integration/AbstractIntegration.php#L829 as per the documentation: https://docs.guzzlephp.org/en/stable/request-options.html#form-params

The above RP addresses this by passing the payload under `\GuzzleHttp\RequestOptions::BODY` instead, **if** the payload is a string, rather than an array.

Tested and working with HubSpot.

* Adding test to the payload key fix

* Creating Client in another method so it could be mocked

Plus some code style improvements

* CS Fixer

* STAN fixes

* Removing whitespace

Co-authored-by: John Linhart <admin@escope.cz>
Co-authored-by: Ruth Cheesley <ruth.cheesley@acquia.com>
@cla-bot cla-bot bot added the cla-signed The PR contributors have signed the contributors agreement label Jan 25, 2022
@RCheesley RCheesley requested a review from a team January 25, 2022 12:23
@RCheesley RCheesley changed the title 4.1 4.1 -> 4.x Jan 25, 2022
@codecov
Copy link

codecov bot commented Jan 25, 2022

Codecov Report

Merging #10789 (45177b6) into 4.x (5792efd) will increase coverage by 0.70%.
The diff coverage is 89.56%.

Impacted file tree graph

@@             Coverage Diff              @@
##                4.x   #10789      +/-   ##
============================================
+ Coverage     44.60%   45.30%   +0.70%     
- Complexity    34879    34890      +11     
============================================
  Files          2089     2089              
  Lines        116938   116987      +49     
============================================
+ Hits          52157    53005     +848     
+ Misses        64781    63982     -799     
Impacted Files Coverage Δ
...es/CampaignBundle/Event/CampaignExecutionEvent.php 58.62% <ø> (+8.62%) ⬆️
app/bundles/CoreBundle/Entity/IpAddress.php 93.44% <ø> (ø)
...es/UserBundle/Controller/Api/UserApiController.php 33.33% <ø> (+33.33%) ⬆️
...s/PluginBundle/Integration/AbstractIntegration.php 30.68% <46.15%> (+8.18%) ⬆️
...SmsBundle/EventListener/CampaignSendSubscriber.php 51.28% <71.42%> (+21.87%) ⬆️
...nnelBundle/Controller/Api/MessageApiController.php 93.33% <80.00%> (+93.33%) ⬆️
...ampaignBundle/Form/Type/CampaignLeadSourceType.php 75.00% <83.33%> (+75.00%) ⬆️
...bundles/ApiBundle/Helper/BatchIdToEntityHelper.php 98.52% <100.00%> (ø)
...les/AssetBundle/EventListener/ReportSubscriber.php 59.20% <100.00%> (+11.23%) ⬆️
...ndles/CoreBundle/Command/UnusedIpDeleteCommand.php 86.36% <100.00%> (+31.81%) ⬆️
... and 42 more

Copy link
Sponsor Member

@escopecz escopecz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Ruth!

@RCheesley RCheesley merged commit 4c30f3a into mautic:4.x Jan 27, 2022
@RCheesley RCheesley deleted the 4.1 branch January 27, 2022 16:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed The PR contributors have signed the contributors agreement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet