Commit Graph

5129 Commits

Author SHA1 Message Date
Jan Lysý
57900f46e6 Display a message when WooCommerce is disabled
[MAILPOET-3477]
2021-04-12 11:11:25 +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
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
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
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
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
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
Pavel Dohnal
0ebdc21a8b Fix flakey integration test
[MAILPOET-3489]
2021-03-30 12:05:47 +02:00
wxa
e55fa5e0b8 Remove unused imports
[MAILPOET-3420]
2021-03-29 15:40:30 +02:00
Pavel Dohnal
2360fe0a5a Check existence panels shen creating debugger
[MAILPOET-3420]
2021-03-29 15:40:30 +02:00
Jan Lysý
8573d99441 Replace timeListener in tests instead of creating new
[MAILPOET-3031]
2021-03-29 15:22:53 +02:00
Jan Lysý
5045dd6aa7 Skip setting created at when is not empty in TimestampListener
[MAILPOET-3031]
2021-03-29 15:22:53 +02:00
Jan Lysý
41324cf62a Add more supported fields to save method
[MAILPOET-3031]
2021-03-29 15:22:53 +02:00
Jan Lysý
09a75e14bd Remove static call WP function.
[MAILPOET-3031]
2021-03-29 15:22:53 +02:00
Jan Lysý
2f263fb988 Fix generate generating unsubscribe token for Subscriber
[MAILPOET-3031]
2021-03-29 15:22:53 +02:00
Jan Lysý
8d58c9beea Fix query for non default subscribed segments
[MAILPOET-3031]
2021-03-29 15:22:53 +02:00
Jan Lysý
bb9d4429ec Add integration test for SubscriberSaveController
[MAILPOET-3031]
2021-03-29 15:22:53 +02:00
Jan Lysý
dcc70b3865 Use doctrine for save Subscriber
[MAILPOET-3031]
2021-03-29 15:22:53 +02:00
Jan Lysý
b8e7fb3dd0 Create SubscriberSaveController
[MAILPOET-3031]
2021-03-29 15:22:53 +02:00
Jan Lysý
761d587573 Add createOrUpdate for SubscriberCustomField
[MAILPOET-3031]
2021-03-29 15:22:53 +02:00
Jan Lysý
d7648bbda0 Add methods for subscribe segments to repository
[MAILPOET-3031]
2021-03-29 15:22:53 +02:00
Jan Lysý
558d44c37d Add value formatting in SubscriberCustomFieldEntity
[MAILPOET-3031]
2021-03-29 15:22:53 +02:00
Jan Lysý
2e3f59423b Add validation on email in SubscriberEntity
[MAILPOET-3031]
2021-03-29 15:22:53 +02:00
Jan Lysý
3c5c297d94 Add support for SubscriberEntity to Security
[MAILPOET-3031]
2021-03-29 15:22:53 +02:00
Jan Lysý
fd5a9904c0 Add listener for updating lastSubscribedAt
[MAILPOET-3031]
2021-03-29 15:22:53 +02:00
wxa
91b2a11643 Add deprecation error to old model static calls
[MAILPOET-3484]
2021-03-29 14:31:44 +02:00
wxa
2947a5a299 Mark DynamicSegment model as deprecated
[MAILPOET-3484]
2021-03-29 14:31:44 +02:00
wxa
42adfa784a Remove old dynamic segments code
[MAILPOET-3484]
2021-03-29 14:31:44 +02:00
wxa
37ac7fd381 Remove unused imports
[MAILPOET-3484]
2021-03-29 14:31:44 +02:00
Rostislav Wolny
3f434aae76 Add acceptance tests for blocking trashing active segments
[MAILPOET-3463]
2021-03-29 12:42:21 +02:00
Rostislav Wolny
51e5206ed8 Fix trashing check to check also welcome and automatic emails
[MAILPOET-3463]
2021-03-29 12:42:21 +02:00
Rostislav Wolny
fc66381da2 Remove client side checks for trashing lists
[MAILPOET-3463]
2021-03-29 12:42:21 +02:00
Rostislav Wolny
271c0a0ec6 Block trashing of a active used single list on API
[MAILPOET-3463]
2021-03-29 12:42:21 +02:00
Rostislav Wolny
a264951904 Skip used segments when bulk trashing segments
[MAILPOET-3463]
2021-03-29 12:42:21 +02:00
Rostislav Wolny
666be344db Unify JS check and API error message for blocking trashing
[MAILPOET-3463]
2021-03-29 12:42:21 +02:00
Rostislav Wolny
f066bc8fdd Disallow trashing single dynamic segment with active email
[MAILPOET-3463]
2021-03-29 12:42:21 +02:00
Jan Lysý
e9080ec0f3 Add dynamic segments support to count shortcode
[MAILPOET-3425]
2021-03-29 12:10:05 +02:00
wxa
dd6aff01db Fix duplicate automatic email for same product
[MAILPOET-3254]

It was happening when a second order was placed which contained the same product and some additional product.
2021-03-29 10:32:37 +02:00