107 Commits

Author SHA1 Message Date
Eloy Lafuente (stronk7)
29a541724f
MDL-65292 style: Fix all the function declaration ordering
This has been generated running the following Sniff,
part of the Moodle's CodeSniffer standard:
- PSR2.Methods.MethodDeclaration

It just ensures all the function declarations have
the correct order for:
- abstract and final.
- visibility (public, protected, private).
- static.

So, all the lines modified by this commit are function declarations
and the only changes are in the positions of those keywords.
2024-02-28 23:47:47 +01:00
Eloy Lafuente (stronk7)
ba1f804ffa
MDL-65292 style: Fix all function declarations white space
This has been generated running the following Sniffs, all
them part of the Moodle's CodeSniffer standard:
- PSR12.Functions.ReturnTypeDeclaration
- PSR12.Functions.NullableTypeDeclaration
- moodle.Methods.MethodDeclarationSpacing
- Squiz.Whitespace.ScopeKeywordSpacing

All them are, exclusively, about correct spacing, so the changes
are, all them, only white space changes.

Only exceptions to the above are 3 changes what were setting the
return type in a new line, and, when that happens, the closing
parenthesis (bracket) has to go to the same line than the colon.
2024-02-28 23:33:26 +01:00
meirzamoodle
78e0fb0818 MDL-78244 lib: Update jQuery to 3.7.1 2023-09-05 14:30:30 +07:00
Marina Glancy
8fc1486d36 MDL-77164 various: fix incorrect phpdocs 2023-04-13 11:35:06 +01:00
Huong Nguyen
d2ae030fa7 MDL-76911 lib: Update jQuery to 3.6.4 2023-03-14 08:45:31 +07:00
Meirza
2a33c2736a MDL-76415 core_privacy: Fixed ${var} string interpolation deprecations.
Since PHP 8.2, placing the dollar sign outside the curly brace is deprecated when
the expression inside the braces resolves to a variable or an expression.
2023-02-13 19:51:47 +07:00
Andrew Nicols
ce85ef1e49 MDL-76362 core_privacy: Shortcircuit URL rewriting on empty content 2023-01-23 09:15:55 +08:00
Marina Glancy
b0a83aa7bd MDL-76362 various: Avoid passing nulls to functions that don't allow nulls
PHP 8.1 is more strict on the parameter type. Functions such as trim(), strlen(), str_replace(), etc
show notice when null is passed as an argument
2023-01-23 09:15:54 +08:00
Jun Pataleta
fb302fe40f Merge branch 'MDL-75469-master' of https://github.com/kevpercy/moodle 2022-10-31 17:10:23 +08:00
Marina Glancy
41b93bd7e5 MDL-73424 general: Internal methods must have same type as parent
Otherwise the error is thrown in PHP8.1
2022-10-10 16:46:13 +02:00
Kevin Percy
c53f9f2db8 MDL-75469 lib: Update jQuery to 3.6.1, jQuery UI to 1.13.2 2022-10-05 13:55:56 +08:00
Sara Arjona
f667bdfb33 MDL-71704 lib: Set Moodle files after JQuery upgrade 2022-01-11 12:07:20 +01:00
Mahmoud Kassaei
95782015ba MDL-71258 questions: privacy support for settings defaults preferences 2021-04-30 10:14:38 +01:00
Eloy Lafuente (stronk7)
cfba0366db Merge branch 'MDL-70893-master' of git://github.com/marinaglancy/moodle 2021-03-18 00:23:26 +01:00
Ilya Tregubov
ec47946ea9 MDL-69680 lib: Update jQuery version in Moodle files 2021-03-04 12:48:26 +08:00
Marina Glancy
0eada7a5f9 MDL-70893 various: optional function arguments must be in the end 2021-02-15 16:53:37 +01:00
Eloy Lafuente (stronk7)
f6711bb394 MDL-67673 phpunit: Fix the return type of template methods
All the setup/teardown/pre/post/conditions template methods
now are required to return void. This was warned with phpunit 7
and now is enforced.

At the same time, fix a few wrong function names,
provider data and param types, return statements...
2020-10-21 12:45:59 +02:00
Eloy Lafuente (stronk7)
de245163e3 MDL-68875 privacy: Keep moodle_content_writer->get_path() the same
In MDL-62853 a new clean_param(PARAM_PATH) was added to the
moodle_content_writer->get_path() method. And this caused some
Windows tests to start failing.

The problem is that clean_param(PARAM_PATH) does normalise directory
separators to be always forward backslashes and that's normally ok
but the get_path() method has some DIRECTORY_SEPARATOR dependent code
that stopped working under windows.

After analysing various solutions, and trying to keep the behavior
EXACTLY like it was before MDL-62853, but with the cleaning included
we have applied 2 changes:

b) Move the clean_param() to later within the array_map() function,
that way the code there, that uses DIRECTORY_SEPARATOR will continue
working the same.

b) As far as there are more DIRECTORY_SEPARATOR dependent code later
in the function, also perform a str_replace() to convert back to the
OS directory separator.

Those 2 points together (a and b) make the behavior to be 100% the
original one, with separators being kept and the paths being cleaned.

This solution corresponds 100% with the proposed fixes named 3) and
4) in the issue.

Final note... all that DIRECTORY_SEPARATOR maybe needs a review because
it really shouldn't be used unless strictly needed. But that falls out
from this issue which goal was to keep things safely working like they
were before the regression (but with the cleaning applied).
2020-06-02 15:53:40 +02:00
Jake Dallimore
33294da864 Merge branch 'MDL-62853' of https://github.com/paulholden/moodle 2020-05-25 16:11:55 +08:00
cescobedo
aeacd6c862 MDL-67798 core_contentbank: Add privacy provider 2020-04-24 16:39:41 +02:00
Paul Holden
d99e0ab7a2 MDL-62853 privacy: sanitize subcontext paths. 2020-04-21 14:38:22 +01:00
Paul Holden
07dc0cad34 MDL-64695 privacy: filter site fullname in data export. 2019-12-12 18:20:13 +00:00
Mihail Geshoski
88d2bc81c8 MDL-65751 lib: Update jQuery version in Moodle files 2019-07-15 08:45:34 +08:00
Binh Thai
658bf9d554 MDL-64291 GDPR export: Context paths can be very long, not unique 2019-01-28 19:49:09 +07:00
sam marshall
fc570e6699 MDL-64497 GDPR: moodle_content_writer can cause endless loop
Fixes a buggy function by replacing it with a call to file_get_contents,
and adds error detection on a couple of file accesses.
2019-01-03 16:54:38 +00:00
Adrian Greeve
34adbfe0b1 MDL-62061 core_privacy: Stop directories being created.
This stops directories being created in the root directory
while running unit tests.
2018-12-06 11:25:32 +01:00
Damyon Wiese
ff015b5f7a MDL-64220 privacy: Clean path params
We need to consistently clean the path params before we use them. This
shows a difference on windows where dir separators are different.
2018-11-27 15:01:41 +08:00
Mark Johnson
80aff7db49 MDL-63660 privacy: Include CSS locally for data export 2018-11-14 14:53:27 +00:00
Andrew Nicols
44e56956c6 MDL-63924 core_privacy: Add shared_userlist provider 2018-11-08 15:39:56 +08:00
Andrew Nicols
bdccab4769 Merge branch 'MDL-63816-master' of git://github.com/mickhawkins/moodle 2018-11-02 08:00:32 +08:00
Michael Hawkins
52e5c8b739 MDL-63816 privacy: Corrected interface get_users_in_context description 2018-10-31 12:11:21 +08:00
Mihail Geshoski
ed69d0aef1 MDL-63690 core_privacy: Handle when add_users() receives an empty array 2018-10-26 09:16:10 +08:00
Andrew Nicols
8ba35e317c MDL-63495 privacy: Add support for removal of multiple users in a context
This issue is a part of the MDL-62560 Epic.
2018-10-17 13:12:18 +08:00
Adrian Greeve
ea81e783ef MDL-62491 privacy: Fix running the download script.
Previously running the code to generate the download file
was very fagile. Now the code can be run anywhere without
problems occuring copying files.
2018-10-09 09:31:13 +08:00
Adrian Greeve
e90a0a7415 MDL-62491 core_privacy: Add html files to the user data export.
This adds html to the data export that allows for easier navigation
and reading of data.
2018-10-08 09:00:08 +08:00
Eloy Lafuente (stronk7)
cf76059eda Merge branch 'MDL-62535-master' of git://github.com/abgreeve/moodle 2018-08-30 01:19:57 +02:00
Michael Hawkins
693f690c18 MDL-62660 tool_dataprivacy: Add ability to expire data requests
Also replaced Completed status with situation specific statuses.
Also improved UX on request pages in line with expiries and the aadditional statuses.
2018-08-20 15:31:20 +08:00
Adrian Greeve
4c6781f009 MDL-62535 privacy: Create deprecated provider interface.
Any interfaces that have become deprecated should extend
this interface.
2018-08-20 11:32:01 +08:00
Eloy Lafuente (stronk7)
c9840c0144 MDL-62619 privacy: Prevent action when boolean queries are involved
Before the patch, queries like:

SELECT 1 FROM dual UNION SELECT 2 FROM dual

were failing badly, with everything but the first numeric element
being ignored by the optimization.

So, being conservative, now we reduce the query being analysed,
ignoring any subquery, inline view (anything within parenthesis
in general) and, in the remaining query, if a boolean query (UNION,
MINUS, INTERSECT...) is found, we don't apply any optimization.
2018-08-09 16:05:55 +02:00
David Mudrák
cea03cbd43 MDL-62619 privacy: Fix some bits of performance improvements
* We need to use is_numeric() in this case as is_int() would never
  return true.
* Extend the supported cases, add support for SQL consisting just of
  numerical value or selectinga numerical constant.
* Do not rely on any particulat letter case in provided SQL.
* Add unit tests for the new method. Even when it is a protected one, it
  is an essential unit to be tested on its own.
2018-07-27 10:14:43 +02:00
Andrew Nicols
d7cb7550c7 MDL-62619 privacy: Improve performance of contexts loading
When possible, we want to use JOIN over WHERE IN. It is known that the
later performs badly in MySQL.
2018-07-27 10:14:43 +02:00
Adrian Greeve
c84cb13cd4 MDL-62574 core_privacy: Check the contextlist for real contexts.
There are situations when contexts will be deleted in the provider.
The context list is not updated and so we have introduced a try
catch.
2018-06-12 11:24:38 +08:00
Andrew Nicols
22c0a30888 MDL-62134 core_privacy: Allow for a failure handler 2018-05-16 11:52:46 +08:00
Marina Glancy
65abf2a37c MDL-62134 privacy: consistantly call components methods 2018-05-16 09:02:01 +08:00
David Monllao
014335fb2b Merge branch 'MDL-62370-master' of git://github.com/andrewnicols/moodle 2018-05-14 16:00:32 +02:00
Andrew Nicols
502344a904 MDL-62370 core_privacy: Directory-less subsystems are compliant 2018-05-14 19:59:43 +08:00
David Monllao
05dcf35796 Merge branch 'MDL-62425-master' of git://github.com/andrewnicols/moodle 2018-05-14 10:57:14 +02:00
Andrew Nicols
66f2da2e0a MDL-62425 core_privacy: Add core to the list of components 2018-05-14 15:40:56 +08:00
Eloy Lafuente (stronk7)
24bd0bc3b3 Merge branch 'MDL-62371-master' of git://github.com/andrewnicols/moodle 2018-05-14 02:37:38 +02:00
Eloy Lafuente (stronk7)
28ec28e026 Merge branch 'MDL-62251-master' of git://github.com/rezaies/moodle 2018-05-13 20:10:44 +02:00