1023 Commits

Author SHA1 Message Date
Neill Magill
5b40aaa5e4 MDL-59515 messages: arguments behave differently with single promise
Seems that objects are not borked by when in the same way as arrays when
there is only a single promise.
2017-07-19 11:52:15 +01:00
Neill Magill
6e594ff687 MDL-59515 messages: arguments behave differently with single promise
When only a single promise is passed the returned array is flattened.
2017-07-19 10:10:25 +01:00
Neill Magill
a5fbe27d8e MDL-59515 messages: Order of popup messages should be predictable
Before this change the messages in the message popup would be loaded
onto a page in a random order, based on the speed at which the user's
browser was able to render each template.

This causes the messages to be attached to the page sequentially, after
they have all been rendered asynchronously.
2017-07-14 15:50:48 +01:00
Eloy Lafuente (stronk7)
f84bdb4347 Merge branch 'MDL-57432-master' of git://github.com/danpoltawski/moodle 2017-07-11 10:44:06 +02:00
Dan Poltawski
bf51478fce Merge branch 'MDL-59317' of https://github.com/NeillM/moodle 2017-07-10 13:28:28 +01:00
Eloy Lafuente (stronk7)
29af7b0b4c MDL-57432 upgrade: clean < 3.0.0 upgrade steps
This just deletes all the upgrade steps previous to 3.0.0. Some
small adjustments, like adding missing MOODLE_INTERNAL or tweaking
globals can also be applied when needed.

Also includes an upgrade step to prevent upgrading from any
version < 2015111600 (v3.0.0) as anti-cheating measure.

Next commit will get rid of/deprecate all the upgradelib functions
not used anymore in codebase.
2017-07-10 09:16:55 +01:00
Ryan Wyllie
7f805edb38 MDL-58332 message: remove concat in get_popup_notifications sql
Removed the concat to generate the uniqueid field for the popup
notifications data. The concat can't be used directly in the SQL because
the syntax changes between databases. The sql_concat helper can't be
used because it assumes all values are database columns (which they
aren't in this case).

Instead I've just removed the uniqueid field because it isn't required
for the union all to work and the field isn't being used by anything.
This should fixed the compatibility issues between databases.
2017-07-10 02:02:26 +00:00
Neill Magill
22481f3d89 MDL-59317 message: Message page taking long time to load
The OR clause in these queries used different sets of columns to select
userid which meant that the indexes that included user id could not be
used.

This change splits the query so that each individual part can use one of
the indexes that includes a userid which speeds them up considerably.
2017-07-06 15:24:02 +01:00
John Okely
46f68f026e MDL-58310 message: No longer need to supress errors from messaging 2017-06-19 09:34:34 +08:00
Dan Poltawski
50c277a5d8 MDL-57139 js: built 2017-06-01 14:54:40 +01:00
Dan Poltawski
877d997fe1 MDL-57139 messages/notifications: ensure promise best practices
Previously there were a few issues with the code

* We were capturing a promise without then then .then() that came after
  it, so our promise wouldn't always be completely resolved by the time
  then next piece of code was operating on it

* We weren't catching all errors with .catch()
2017-06-01 10:27:58 +01:00
Eloy Lafuente (stronk7)
5e27228335 MDL-58933 upgrade: add 3.3.0 separation line to all upgrade scripts 2017-05-19 19:22:07 +02:00
Eloy Lafuente (stronk7)
d989ee1e03 MDL-58853 versions: bump all versions and requires near release
version = 2017051500 release version
requires= 2017050500 current rc1 version
2017-05-09 02:58:28 +02:00
Mark Nelson
685daf1aed MDL-58650 core_message: always use 'popup' processor for messages 2017-05-02 15:46:48 +08:00
Marina Glancy
fde2e5b1a7 MDL-58452 ajax: do not show popup when can't retrieve the message count 2017-04-07 16:05:19 +08:00
Simey Lameze
fdeeaff954 MDL-58265 core_test: replace I turn editing on steps
Also remove few more unnecessary steps that redirects behat to
site home page to actually get to the course.

Part of MDL-55611 epic.
2017-04-03 11:37:07 +08:00
Simey Lameze
c987d1b2ef MDL-58265 core_test: replace all uses of I follow course steps
Part of MDL-55611 epic.
2017-04-03 11:37:07 +08:00
Dan Poltawski
83a6b8c48c Merge branch 'MDL-58050-master-msgtrans' of git://github.com/mudrd8mz/moodle 2017-03-20 13:19:22 +00:00
David Monllao
28b1cc19e7 Merge branch 'MDL-57419-master-2' of https://github.com/xow/moodle 2017-03-20 07:33:25 +01:00
Damyon Wiese
8857c715d1 MDL-40759 icons: Behat fixes for font-awesome 2017-03-17 15:52:18 +08:00
Damyon Wiese
663640f5b3 MDL-40759 icons: convert uses of pix_url to pix_icon
Also change filepicker to use scaled svgs instead of sets of custom pngs. The svgs are taken from font-awesome.
2017-03-17 15:52:17 +08:00
John Okely
e09066d0eb MDL-57419 messaging: Don't use enter to send 2017-03-16 10:46:40 +08:00
Marina Glancy
6e65554ea1 MDL-58010 user: allow to update only whitelisted user preferences 2017-03-10 18:04:47 +00:00
David Mudrák
bb2924d018 MDL-58050 message: Commit the transaction before the early return
If there was no conversation found and the method returned early, the
active transaction was not marked as committable and the error was
reported by the request shutdown handler.

Attaching a unit test for the case just because it did not seem to be
covered. I was trying to reproduce the thrown error in the unit test but
it can't be used in this case. The shutdown handler puts the warning
directly into the error_log and it is not guaranteed where such messages
go (depending on the PHP configuration). And we do not even raise it
during the unit test execution (presumably due to noise it would
produce) anyway.
2017-02-22 13:56:02 +01:00
David Mudrák
0c44da7887 MDL-58050 message: Fix the DB transaction handling
Consumer code is not supposed to call commit_delegated_transaction()
method directly, this was incorrect usage of the delegated transactions.
2017-02-22 13:42:05 +01:00
David Monllao
cb0f30cf77 Merge branch 'MDL-58014_master' of git://github.com/markn86/moodle 2017-02-20 09:32:11 +01:00
Mark Nelson
29c3b0b4d2 MDL-58014 core_message: fixed unread message count 2017-02-20 13:29:13 +08:00
Mark Nelson
f512355b31 MDL-57967 core_message: do not process conversations from deleted users 2017-02-16 13:01:06 +08:00
Ryan Wyllie
e12d9f494c MDL-57370 message: add unread count to conversation tests 2017-02-09 03:39:14 +00:00
Ryan Wyllie
c9b82e402e MDL-57370 message: improve message union sql 2017-02-09 03:39:09 +00:00
Ryan Wyllie
42e2f6c0e9 MDL-57370 message: fix duplicate ids 2017-02-08 07:40:07 +00:00
Dan Poltawski
125fa38af3 Merge branch 'MDL-57370-master' of git://github.com/ryanwyllie/moodle 2017-02-07 10:35:13 +00:00
Ryan Wyllie
b1e6f1a8fb MDL-57370 message: deprecate message_get_recent_conversations 2017-02-07 01:40:47 +00:00
Ryan Wyllie
98be2d2009 MDL-57370 message: change indexes on message tables 2017-02-07 01:40:47 +00:00
Ryan Wyllie
4d146f1a45 MDL-57370 message: unit tests for get_conversations 2017-02-07 01:04:11 +00:00
Ryan Wyllie
349f426197 MDL-57370 message: remove joins from get_conversations
I have broken up the single query that was doing multiple joins on the
messaging and user tables. It no longer does any joins and will instead
query each data set individually.

This may cost more in terms of PHP processing but it will mean that
standard database tunings should be able to handle larger data sets.

For example this function was taking a long time to run on moodle.org
and was causing the MySQL join buffer to overflow.
2017-02-07 01:04:11 +00:00
Rajesh Taneja
9bb156ee75
MDL-57853 phpunit: Remove use of setExpectedException 2017-02-06 11:44:42 +08:00
Andrew Nicols
ea6eb1cc48 Merge branch 'MDL-57630-m' of https://github.com/micaherne/moodle 2017-02-02 09:18:17 +08:00
Andrew Nicols
81c226d451 Merge branch 'MDL-57634-m' of https://github.com/micaherne/moodle 2017-01-18 12:36:45 +08:00
Michael Aherne
55b2a33ce1 MDL-57634 messaging: Ensure test uses a configured plugin 2017-01-12 12:30:39 +00:00
Michael Aherne
46c5c88321 MDL-57630 messaging: Pass unit test with third-party plugins 2017-01-11 16:37:46 +00:00
Eloy Lafuente (stronk7)
777361983c Merge branch 'wip-mdl-56519-m' of https://github.com/rajeshtaneja/moodle 2017-01-11 02:42:29 +01:00
Rajesh Taneja
57bee542ab
MDL-56519 behat: Fixed lint errors 2017-01-03 09:12:54 +08:00
David Monllao
7eeb375380 Merge branch 'MDL-57338-master' of git://github.com/danpoltawski/moodle 2016-12-29 10:44:01 +01:00
David Monllao
edda5120e2 Merge branch 'MDL-57331-master' of https://github.com/xow/moodle 2016-12-28 21:21:04 +00:00
Dan Poltawski
514ab739fb MDL-57338 message: fix template component 2016-12-22 12:50:38 +00:00
John Okely
9e7b172a02 MDL-57331 messaging: Fix sent messages appearing twice. 2016-12-20 10:47:14 +08:00
Mark Nelson
c9431a5be8 MDL-57270 core_message: trim message before it is sent 2016-12-14 12:18:58 +08:00
Andrew Nicols
75af0aa680 Merge branch 'MDL-57266' of git://github.com/stronk7/moodle 2016-12-07 09:53:16 +08:00
Eloy Lafuente (stronk7)
75c57a08fb MDL-57266 upgrade: add 3.2.0 separation line to all upgrade scripts 2016-12-05 17:10:20 +01:00