This fixes a warning comming fromm WooCommerce blocks:
Scripts that have a dependency on [wc-settings, wc-blocks-checkout] must be loaded in the footer, mailpoet-marketing-optin-block-editor-script was registered to load in the header, but has been switched to load in the footer instead.
[MAILPOET-4030]
The select2 data format requires that all option objects include both an
`id` and `text`. See https://select2.org/data-sources/formats
By restoring these duplicate properties, we avoid having to write and
maintain a custom matcher method, and we're protecting ourselves
against any other unexpected behavior in the future resulting from
these options not having the required `text` property.
[MAILPOET-3958]
Instead of the search results simply looking to see if a word contains
the term searched for, this makes it so the term has to match the
beginning of one of the words.
For example, let's say the options were:
- First name
- Confirmation time
Previously, a search for "n" would return both, because there is an n in
the word Confirmation. With this change, only First name would match
because the word name starts with n.
See the Jira ticket for discussion.
[MAILPOET-3958]
There is a bug with jQuery 3.6.0 and select2 4.1.0-rc.0, both the most
current versions of the packages, where select dropdown search inputs
don't receive focus when they're opened. See
https://github.com/select2/select2/issues/5993 for more details.
Unfortunately the 'select2:open' event doesn't include anything that
seems helpful to locate the input that was opened, which is why
I'm using document.querySelectorAll.
Another quirk is that select2 adds two elements to the DOM when our
select is opened: an input and a textarea, both with almost identical
attributes. The query could just as easily look for
`input.select2-search__field`, but it seems clearer to me that the
element with the aria-controls attribute is the appropriate one to
choose (to be clear, the irrelevant textarea doesn't have that).
This will likely be addressed in future releases of jQuery or select2
and the fix should be removed when it's no longer necessary.
[MAILPOET-3958]
Non unique count parameter name was causing that when more conditions
used all of operand the count parameter was overrode in the final combined query.
[MAILPOET-4010]
This creates a single method we can rely on to check for the uniqueness
of a segment name and refactors places where we had duplicate code to
use the new method.
[MAILPOET-3998]
This commit is part of a task to allow multiple values in "is in country" segment. This commit replaces the queries with the more performant ones written by @lysyjan. It also creates the lookup tables on the integration database and updates the test.
[MAILPOET-3952]
This commit is part of a task to allow multiple values in "is in country" segment. This commit first changes the string value $country to Array, adding a check for backwards compatibility and an integration test.
[MAILPOET-3952]