The cache invalidation check was previously occuring every time either
the `set` or `get` function was called on the cache. However, the cache
invalidation check is based on the jsrev which is static for the
lifetime of the page.
This change moved the invalidation to happen during the setup of the AMD
module such that it only happens one time per storage type (Local +
Session).
We only use the jsrevPrefix to determine if the cache should be
invalidated, but the prefix that we were using is based on the new
jsrev.
For example, the jsrevPrefix will be:
hash(wwwroot + '/ + config.jsrev) + '/jsrev'
Where config.jsrev is the _current_ (new) jsrev.
As a result when searching for the jsrev used to store the data which is
currently in the storage cache, no key is returned, and we instead set
an 'initial' value and the cache is not cleared
This patch changes the jsrevPrefix to be:
hash(wwwroot) + '/jsrev'
Since the wwwroot does not change, the key remains static for the
current site. As a result, when the jsrev is bumped via a Moodle cache
purge, we are able to correctly fetch the old jsrev from the cache,
determine that the jsrev has changed, and purge the cache.
This change allows you to write and run Behat tests that cover the
mobile app. These should have the @app tag. They will be run in the
Chrome browser using an Ionic server on the local machine.
See config-dist.php for configuration settings, or full docs here:
https://docs.moodle.org/dev/Acceptance_testing_for_the_mobile_app
For accessibility we don't want to read an icon with a label immediately next to the label,
but in this case it's clearer for the icon to have no alt text / title for both
screen readers and non-screen readers. Worse is not reading important information just
because it's displayed as an icon.
The explicit usage of the constants FILTER_FLAG_SCHEME_REQUIRED and
FILTER_FLAG_HOST_REQUIRED is now deprecated; both are implied for
FILTER_VALIDATE_URL anyway.
Multiple issues fixed:
* Fixed order of the statements to avoid access to undefined variables.
* Fixed population of the SQL query parameter to make sure they match
the placeholder in the query.
* Fixed missing table aliases in the second query to make sure the query
actually works as expected.
This includes a minor restructure of the autocomplete JS to make use of
promises and improve tracking of pending JS.
In particular it improves the way in which throttled text input is
handled to ensure that the behat does not continue until:
- typing is fully complete; and
- all possible ajax requests have been sent; and
- all possible ajax requests complete; and
- the suggestions are updated.
A number of conditions existed where behat would move on to the next
step too early in a race condition effect between Behat and Autocomplete.