Commit Graph

15 Commits

Author SHA1 Message Date
Rodrigo Primo
5c6000bed6 Fix: duplicated entries when exporting subscribers of dynamic segments
This commit fixes a bug in the code that exports subscribers to a CSV
file. This bug caused duplicated entries when exporting subscribers of
dynamic segments. Instead of a given subscriber appearing only once in the
CSV file, they would be included multiple times, and the number of times
would depend on the number of static segments that they had subscribed to.

This bug was caused by a problem in the code that generates the SQL
query used to fetch the subscribers that will be exported. The same
method is used for subscribers not linked to a segment, static
segments, and dynamic segments. The table wp_mailpoet_segments was
included in the query in the three cases, but it should not be included
for dynamic segments as this type of segment does not have a
corresponding entry in this table. Including this table without
specifying a segment ID (as there is not one for dynamic segments),
meant that MySQL would return an extra entry for a given subscriber for
each static segment that they had subscribed to.

[MAILPOET-3900]
2021-11-22 14:33:58 +01:00
Rostislav Wolny
73a9bed483 Replace deprecated doctrine methods in lib directory
[MAILPOET-3889]
2021-10-28 15:44:18 +02:00
Pavel Dohnal
21839fc30b Fix indentation of multiline function declarations
[MAILPOET-3732]
2021-09-17 12:17:36 +02:00
Pavel Dohnal
cdda3480ca Make all constructor signatures multiline
[MAILPOET-3732]
2021-09-16 14:19:40 +02:00
Rodrigo Primo
e59992cc16 Fix checkGenericClassInNonGenericObjectType PHPStan errors
This commit removes the checkGenericClassInNonGenericObjectType flag
from PHPStan configuration files and fixes all associated errors in our
code base.

[MAILPOET-3236]
2021-08-09 12:58:56 +02:00
Rostislav Wolny
7a3ffa388f Update PHPStan
[MAILPOET-3658]
2021-07-06 13:29:00 +02:00
Pavel Dohnal
ce48153b12 Fix code using the combined segments
[MAILPOET-3212]
2021-03-23 15:58:34 +01:00
Jan Lysý
f3a54c0cec Remove distinct statement from export query
[MAILPOET-3505]
2021-03-22 13:37:42 +01:00
Rostislav Wolny
aff4c9d5b7 Fix dynamic segments filtering in subscriber export
[MAILPOET-3177]
2021-03-10 15:20:32 +01:00
wxa
e71e063ef0 Use same query logic for counting and exporting subs w/o lists
[MAILPOET-3462]
2021-03-10 13:16:48 +01:00
Rostislav Wolny
6f42222abc Fix subscriber consent data in export
[MAILPOET-3472]
2021-03-09 13:13:55 +01:00
Jan Lysý
302f9f2ca9 Set dynamic segment name via Doctrine parameter
[MAILPOET-3376]
2021-03-08 09:09:00 +01:00
Jan Lysý
8450beaf10 Add tests for get subscribers in ImportExportRepository
[MAILPOET-3376]
2021-03-08 09:09:00 +01:00
Jan Lysý
b2e0bac2d8 Add function for export subscribers to repository
[MAILPOET-3376]
2021-03-08 09:09:00 +01:00
Jan Lysý
7b893dfb51 Move multi insert functionality to a special repository
[MAILPOET-3378]
2021-02-18 10:13:44 +01:00