Commit Graph

13768 Commits

Author SHA1 Message Date
Jan Lysý
b739d44f1b Add usage StatisticsForms from Populator
[MAILPOET-3032]
2021-04-12 14:26:36 +02:00
Jan Lysý
fc455d7cfa Add saving custom fields on subscribe
[MAILPOET-3032]
2021-04-12 14:26:36 +02:00
Jan Lysý
02e1ce7e4d Remove getFields method from FormEntity
[MAILPOET-3032]
2021-04-12 14:26:36 +02:00
Jan Lysý
5af29f8aac Use Carbon::instance method in DateTimeTzToStringType
[MAILPOET-3032]
2021-04-12 14:26:36 +02:00
Jan Lysý
3d5905c288 Remove usage old model from FormsResponseBuilderTest
[MAILPOET-3032]
2021-04-12 14:26:36 +02:00
Jan Lysý
24264544ec Mark old model SubscriberIP as deprecated
[MAILPOET-3032]
2021-04-12 14:26:36 +02:00
Jan Lysý
31bff0efb4 Remove rest of usage old model SubscriberIP
[MAILPOET-3032]
2021-04-12 14:26:36 +02:00
Jan Lysý
5ce4eeed10 Fix flaky test in SubscriberActionsTest
[MAILPOET-3032]
2021-04-12 14:26:36 +02:00
Jan Lysý
5ef040bb93 Add integration test for SubscriberSubscribeController
[MAILPOET-3032]
2021-04-12 14:26:36 +02:00
Jan Lysý
52f988d91e Add integration test for StatisticsFormsRepository
[MAILPOET-3032]
2021-04-12 14:26:36 +02:00
Jan Lysý
4d56020071 Remove usage old model from Throttling
[MAILPOET-3032]
2021-04-12 14:26:36 +02:00
Jan Lysý
4631fb7320 Add SubscriberIP entity and repository
[MAILPOET-3032]
2021-04-12 14:26:36 +02:00
Jan Lysý
67f648279f Mark old StatisticsForms model as deprecated
[MAILPOET-3032]
2021-04-12 14:26:36 +02:00
Jan Lysý
a715aa9b76 Replace usages of StatisticsForms with Doctrine
[MAILPOET-3032]
2021-04-12 14:26:36 +02:00
Jan Lysý
6a8dbc6123 Add StatisticsFormsRepository
[MAILPOET-3032]
2021-04-12 14:26:36 +02:00
Jan Lysý
d530b02843 Add StatisticsFormEntity
[MAILPOET-3032]
2021-04-12 14:26:36 +02:00
Jan Lysý
66a0834a37 Use CustomFieldRepository in integration APITest
[MAILPOET-3032]
2021-04-12 14:26:36 +02:00
Jan Lysý
e1994e64b8 Set default label in CustomFieldsRepository
[MAILPOET-3032]
2021-04-12 14:26:36 +02:00
Jan Lysý
52b3e34839 Create controller for subscribe Subscribers
[MAILPOET-3032]
2021-04-12 14:26:36 +02:00
Jan Lysý
d5de54b1d5 Refactor Throttling to service
[MAILPOET-3032]
2021-04-12 14:26:36 +02:00
Jan Lysý
13b4c74c00 Use Doctrine in SubscriberActions integration tests
[MAILPOET-3032]
2021-04-12 14:26:36 +02:00
Jan Lysý
7db23849f7 Use Doctrine in SubscriberActions
[MAILPOET-3032]
2021-04-12 14:26:36 +02:00
Jan Lysý
f92d31fdb6 Reset subscriber's unconfirmed data on save
[MAILPOET-3032]
2021-04-12 14:26:36 +02:00
Jan Lysý
ce6c38cfd3 Fix default status for new subscriber
[MAILPOET-3032]
2021-04-12 14:26:36 +02:00
Jan Lysý
69d5eb42f7 Use Doctrine in RequiredCustomFieldValidator
[MAILPOET-3032]
2021-04-12 14:26:36 +02:00
Rodrigo Primo
5ceb084c64 Refactor Forms::delete() to use Doctrine
[MAILPOET-3039]
2021-04-12 13:35:14 +02:00
Rodrigo Primo
49f0c054fd Refactor Forms::restore() to use Doctrine
[MAILPOET-3039]
2021-04-12 13:35:14 +02:00
Rodrigo Primo
e054f05222 Refactor Forms::trash() to use Doctrine
[MAILPOET-3039]
2021-04-12 13:35:14 +02:00
Pavel Dohnal
86fa574ce8 Fix exhausted memory during woocommerce sync 2021-04-12 11:42:00 +02:00
Jan Lysý
966d6f36ff Add integration test for SegmentDependencyValidator
[MAILPOET-3477]
2021-04-12 11:11:25 +02:00
Jan Lysý
8090dd1bb3 Add acceptance test for missing plugin message
[MAILPOET-3477]
2021-04-12 11:11:25 +02:00
Jan Lysý
99eff6129c Add redirect when segment doesn't exist
[MAILPOET-3477]
2021-04-12 11:11:25 +02:00
Jan Lysý
57900f46e6 Display a message when WooCommerce is disabled
[MAILPOET-3477]
2021-04-12 11:11:25 +02:00
Rostislav Wolny
49edb9e02a Add test for woo commerce dynamic segments editing
[MAILPOET-3555]
2021-04-12 09:24:05 +02:00
Rostislav Wolny
6f6bbbd1a3 Ensure same data types for all autocompelete list items
In client code we expect that botch category and product ids
are strings but we send strings for lists based on posts and integers
for lists based on terms. We use mostly string values so this change unifies
that all ids for autocomplete lists are strings.
[MAILPOET-3555]
2021-04-12 09:24:05 +02:00
Rodrigo Primo
a7fe876180 Fix PHPStan undefined property error introduced after update to version 0.12.83
This commit fixes the following PHPStan error what started happening
after the update to version 0.12.83. It seems that our model classes
work with properties using both snake_case and camelCase names, so that
is why the change made here doesn't affect the modified unit test.

```
 ------ ---------------------------------------------
  Line   tests/integration/Models/SubscriberTest.php
 ------ ---------------------------------------------
  740    Access to an undefined property
         MailPoet\Models\Subscriber::$deleted_at.
 ------ ---------------------------------------------
```

[MAILPOET-3491]
2021-04-12 08:55:14 +02:00
Rodrigo Primo
8c4805cd0a Update pattern to ignore PHPStan error
Since we updated to PHPStan 0.12.83 we started getting the error bellow.
It seems this happened because the message of an error that we were
already ignoring was changed. This commit simply updates the pattern we
use to ignore the error to reflect the change in the new PHPStan
version.

```
 ------ ---------------------------------------------------------------------
  Line   lib/Features/FeatureFlagsController.php
 ------ ---------------------------------------------------------------------
         Ignored error pattern #^Cannot access offset \(int\|string\) on
         array\|false# in path
         /home/circleci/mailpoet/lib/Features/FeatureFlagsController.php was
         not matched in reported errors.
  44     Cannot access offset (int|string) on array<string,
         MailPoet\Entities\FeatureFlagEntity>|false.
 ------ ---------------------------------------------------------------------
```

[MAILPOET-3491]
2021-04-12 08:55:14 +02:00
Rodrigo Primo
030bd8c1c8 Fix PHPStan parameter type error introduced after update to version 0.12.83
This commit fixes the following PHPStan errors introduced after the update to version 0.12.83:

```
 ------ ----------------------------------------------------------------------
  Line   lib/Newsletter/Renderer/Blocks/Footer.php
 ------ ----------------------------------------------------------------------
  18     Parameter #1 $html of method MailPoet\Util\pQuery\pQuery::parseStr()
         expects string, array|string|null given.
 ------ ----------------------------------------------------------------------

 ------ ----------------------------------------------------------------------
  Line   lib/Newsletter/Renderer/Blocks/Header.php
 ------ ----------------------------------------------------------------------
  18     Parameter #1 $html of method MailPoet\Util\pQuery\pQuery::parseStr()
         expects string, array|string|null given.
 ------ ----------------------------------------------------------------------
```

[MAILPOET-3491]
2021-04-12 08:55:14 +02:00
Rodrigo Primo
90526362cc Ignore PHPStan Carbon related error introduced after update to version 0.12.83
This commit ignores the following PHPStan error introduced after the update to version 0.12.83. It seems the error is caused by a problem in Carbon's documentation so there is not way for us to fix it for now. Carbon's constructor accepts an instance of DateTimeInterface, but its phpdoc block only mentions string or null.

```
 ------ ----------------------------------------------------------------------
  Line   lib/Entities/NewsletterEntity.php
 ------ ----------------------------------------------------------------------
  283    Parameter #1 $time of class MailPoetVendor\Carbon\Carbon constructor
         expects string|null, DateTimeInterface|null given.
 ------ ----------------------------------------------------------------------
```
[MAILPOET-3491]
2021-04-12 08:55:14 +02:00
Rodrigo Primo
3d31f1f030 Fix PHPStan callback error introduced after update to version 0.12.83
This commit fixes the following PHPStan errors introduced after the
update to version 0.12.83:

```
 ------ ----------------------------------------------------------------------
  Line   lib/Listing/Handler.php
 ------ ----------------------------------------------------------------------
  18     Parameter #1 $callback of function call_user_func_array expects
         callable(): mixed, array(class-string|object, 'listingQuery') given.
  45     Parameter #1 $callback of function call_user_func_array expects
         callable(): mixed, array(class-string|object, 'groups') given.
  54     Parameter #1 $callback of function call_user_func_array expects
         callable(): mixed, array(class-string|object, 'filters') given.
  62     Parameter #1 $callback of function call_user_func_array expects
         callable(): mixed, array(class-string|object, 'listingQuery') given.
 ------ ----------------------------------------------------------------------
```

It was necessary to use both is_callable() and method_exists() instead
of just is_callable(), as a parent class of the model classes implements
__call() and thus is_callable() always returns true even when the
method doesn't exist (and in those cases method_exists() returns false).

[MAILPOET-3491]
2021-04-12 08:55:14 +02:00
Rodrigo Primo
0f6d7a5627 Update PHPStan to 0.12.83
[MAILPOET-3491]
2021-04-12 08:55:14 +02:00
Rodrigo Primo
b3f82cccc5 Refactor Forms::duplicate() to use Doctrine instead of Paris
[MAILPOET-3038]
2021-04-07 09:48:53 +02:00
Rostislav Wolny
3d2c62fc16 Unify list vs segment naming with a rest of codebase
[MAILPOET-3418]
2021-04-07 09:48:31 +02:00
Rostislav Wolny
3dc5c5ce80 Add return typehint to check deleted segments method
[MAILPOET-3418]
2021-04-07 09:48:31 +02:00
Rostislav Wolny
bbd4cb98f8 Skip empty subscribers batches during sending
[MAILPOET-3418]
2021-04-07 09:48:31 +02:00
Rostislav Wolny
5331d76c79 Add error notice for sending newsletter with deleted list
[MAILPOET-3418]
2021-04-07 09:48:31 +02:00
Rostislav Wolny
b3da3ec1bc Pause running tasks that have deleted or trashed segments
[MAILPOET-3418]
2021-04-07 09:48:31 +02:00
Rostislav Wolny
6183258489 Add comment describing why welcome emails don't have segments
[MAILPOET-3418]
2021-04-07 09:48:31 +02:00
Rostislav Wolny
605005dc08 Use doctrine for cleanup in SendingQueueWorker test
[MAILPOET-3418]
2021-04-07 09:48:31 +02:00
Rostislav Wolny
de210991a4 Refactor creation of sending queue worker in test
[MAILPOET-3418]
2021-04-07 09:48:31 +02:00