This was causing flakiness of acceptance test ReinstallFromScratchCest.php:reinstallFromScratch
and also potential issue for production.
In Activator::deactivate we remove MailPoet's DB tables. This takes some time.
In case there is another request during the deletion it may detect some tables are missing and trigger activation
and we end up creating MailPoet tables and removing them at the same time.
This commit adds locking to deactivate method so that any other attempt for activation ends up with an error.
[MAILPOET-4274]
It was necessary to deprecate the filter
mailpoet_archive_email_subject and create a new one since the type
of one of the parameters passed to the filter had to change.
[MAILPOET-4307]
MySQL has maximum key lengths for indexes, and the number can vary based
on storage engine and MySQL version. Using utf8mb4, the index would be
255 * 4 = 1020 bytes long, exceeding the MyISAM maximum of 1000 bytes
and the MySQL 5.6 maximum of 767 bytes.
See Column Prefix Key Parts in the MySQL reference:
https://dev.mysql.com/doc/refman/8.0/en/create-index.html
By reducing this length to 191, we ensure that the maximum likely index
length will be less than the 767 lower bound (191 * 4 = 764).
MAILPOET-4489
This commit fixes the logic of the code that enables third party
libraries by default. It was meant to enable those libraries only for
existing installs when the code was introduced in cfae753601
to avoid breaking functionality. But due to a bug, it was also enabling
those libraries for new installs.
To fix this issue, this commit moves the code to the Migrator class and
makes sure it is only executed for existing installs and only once when
doing a version update.
[MAILPOET-4285]
The original FileSystemCache of twig generates the key depending on PHP_VERSION.
We need to produce the same key regardless of PHP_VERSION. Therefore
TwigFileSystemCache overwrites this method.
[MAILPOET-3985]
This commit introduces our own TwigEnvironment class which extends the original Twig\Environment.
The original class produced a different templateClass depending on the PHP version and
the selected options. As we can not rely on PHP version, this would have produced different
template hash keys in the end and Twig would have attempted to store new templates
on the disk, which we want to prevent.
[MAILPOET-3985]