Commit Graph

12498 Commits

Author SHA1 Message Date
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
Pavel Dohnal
1c4bb7d22e Release 3.60.7 2021-04-07 09:35:59 +02:00
Jan Lysý
aaf85e0415 Fix reset subscriptions in SegmentsRepository
When we update subscriber segment status via executeUpdate,
we have to refresh state from the DB.

[MAILPOET-3551]
2021-04-06 13:51:50 +02:00
Jan Lysý
0ff3f9bf04 Add check that GET array key exists
[MAILPOET-3550]
2021-04-06 10:00:13 +02:00
Ján Mikláš
aad4ea3ece Update Storybook.js library
[MAILPOET-3546]
2021-04-05 11:14:27 +02:00
Jan Lysý
afd62b5b9e Add missing column collation detection for single sync
[MAILPOET-3543]
2021-04-05 10:58:30 +02:00
Jan Lysý
7ef0f7a600 Create simple router with newsletters redirect
[MAILPOET-3536]
2021-04-05 10:26:53 +02:00
Veljko
a6215e22ba Add clear field to fix the test 2021-03-31 13:20:35 +02:00
Rodrigo Primo
faf714e832 Remove more uses of the old models inside FormsTest
[MAILPOET-3036]
2021-03-31 11:37:07 +02:00
Rodrigo Primo
4b5f044f6b Use __() instead of \MailPoet\WP\Functions::__()
[MAILPOET-3036]
2021-03-31 11:37:07 +02:00
Rodrigo Primo
5f262e6b04 Update comment to explain empty methods
[MAILPOET-3036]
2021-03-31 11:37:07 +02:00
Rodrigo Primo
a18ae06f8a Rewrite Forms::listing() API to use Doctrine
This commit replaces the usage of Paris with Doctrine inside
MailPoet\API\JSON\v1\Forms::listing(). It also introduces a new class
MailPoet\Form\Listing\FormListingRepository that is used by listing() to
prepare the query that is executed by Doctrine and a new
MailPoet\API\JSON\ResponseBuilders\FormsResponseBuilder::buildForListing()
method to prepare the response that is returned by listing(). A few tests were
adjusted and new tests were added for the new class.

[MAILPOET-3036]
2021-03-31 11:37:07 +02:00
Rodrigo Primo
298b8730fe Updates parts of FormsTest to use Doctrine entities
This commit simply updates parts FormsTest to use Doctrine entities
instead of Paris objects.

[MAILPOET-3036]
2021-03-31 11:37:07 +02:00
Pavel Dohnal
4546b5be68 Fix links data
[MAILPOET-3476]
2021-03-31 10:50:18 +02:00
Pavel Dohnal
410a6ff626 Fix validating segments
[MAILPOET-3476]
2021-03-31 10:50:18 +02:00
Pavel Dohnal
db85b397a4 Rename selection
[MAILPOET-3476]
2021-03-31 10:50:18 +02:00
Pavel Dohnal
ae1a80ea25 Avoid unnecesary loads
[MAILPOET-3476]
2021-03-31 10:50:18 +02:00
Pavel Dohnal
f85850a19e Use correct value for searching for links
[MAILPOET-3476]
2021-03-31 10:50:18 +02:00
Pavel Dohnal
a864ec96ee Convert older data after loading
[MAILPOET-3476]
2021-03-31 10:50:18 +02:00
Pavel Dohnal
7d79c7d2b7 Remove window usage from component
[MAILPOET-3476]
2021-03-31 10:50:18 +02:00
Pavel Dohnal
5480ceb879 Fix tests
[MAILPOET-3476]
2021-03-31 10:50:18 +02:00