22010 Commits

Author SHA1 Message Date
Andrew Nicols
ff3778bf97 MDL-29738 file: Remove unused stylesheet functionality
This functionality was commented out in
78946b9bdb1299a21f00b88d81c73ad8700c951e for MDL-20204 back in 2009.
Since then it has been wasting cycles performing utterly pointless
preg_match and preg_replace calls.

The decision has been made to deprecate it in stables, and remove it in
3.2.
2016-07-05 19:31:22 +08:00
Juan Leyva
7c4e686f94 MDL-54943 webservice: New WS core_course_get_activities_overview 2016-07-05 09:10:13 +01:00
Juan Leyva
460897052e MDL-54869 files: Create new required functions
This was a complex change requiring three new functions:
file_merge_files_from_draft_area_into_filearea - To just add files from a draft area into a real one (just adding or updating, not deleting)
file_merge_draft_area_into_draft_area - To merge files from two draft areas, used by the latest for creating a draft area with all the original files plus the new ones.
file_overwrite_existing_draftfile - Required to update existing files not losing metadata or references.

The whole process is the following:

    User uploads a file (upload.php)
    Client gets a new draftid A containing the file only (return of upload.php)
    Client requests to merge that draftid in the user's private files (core_user_add_user_private_files)
    Server prepares a new UNUSED draftid B from existing area
    Server merges A into B
    Server saves the draft B into the final area
2016-07-05 09:01:34 +01:00
Juan Leyva
d089e4984d MDL-54869 files: Fix file_save_draft_area_files documentation 2016-07-05 08:40:06 +01:00
Andrew Nicols
69efe54640 Merge branch 'MDL-53495' of https://github.com/mr-russ/moodle 2016-07-05 15:07:21 +08:00
Andrew Nicols
5e47d5aee5 Merge branch 'MDL-54951-master' of git://github.com/jleyva/moodle 2016-07-05 09:41:31 +08:00
Andrew Nicols
642a1d5480 Merge branch 'MDL-53019' of git://github.com/stronk7/moodle 2016-07-05 08:15:02 +08:00
Eloy Lafuente (stronk7)
ae96cf6246 MDL-53019 php: bump all harcoded versions to new 5.6.5 requirement
Moodle 3.2 and up will require PHP >= 5.6.5. Hopefully some day we'll
have this centralized with MDL-39007, just it's not done yet.

Thanks to Stephen Bourget for raising this!
2016-07-05 01:50:43 +02:00
Dan Poltawski
98ebfabc13 Merge branch 'MDL-54994' of git://github.com/stronk7/moodle 2016-07-04 14:18:15 +01:00
Dan Poltawski
0cf471fbdd Merge branch 'MDL-55041_master' of https://github.com/marxjohnson/moodle 2016-07-04 12:45:55 +01:00
Marina Glancy
ed63718caa MDL-55069 core: escape special characters in email headers 2016-07-04 12:27:58 +01:00
Juan Leyva
ae584b3b5e MDL-54951 webservice: Utility methods for generating a list of files
It includes a new external_files structure and a get_area_files method
in external_util
2016-07-04 09:24:27 +01:00
Andrew Nicols
4ffe12b0f8 Merge branch 'MDL-55020-master-pluginzip' of git://github.com/mudrd8mz/moodle 2016-07-04 10:54:59 +08:00
Eloy Lafuente (stronk7)
1de0b34bed Merge branch 'MDL-54947' of https://github.com/mr-russ/moodle 2016-07-04 01:05:12 +02:00
Mark Johnson
4d9036d6eb MDL-55041 roles: Fix JSON parsing in permission manager 2016-07-01 14:54:01 +01:00
Eloy Lafuente (stronk7)
a763bb0553 MDL-54994 badges: Count correctly the number of external badges shown 2016-07-01 13:40:47 +02:00
Jake Dallimore
9e12b0faf7 MDL-54795 mod_assign: Fix notifications JS error in grading interface 2016-07-01 13:49:02 +08:00
David Mudrák
2785fd193d MDL-55020 admin: Fix renaming of the plugin package root folder
There was a problem with core\update\code_manager::unzip_plugin_file()
if it was used to extract a plugin package into a non-empty target
directory and the plugin package root folder was being renamed at the
same time.

The problem was caused by the underlying helper method
rename_extracted_rootdir() that worked only for ZIPs extracted to an
empty temporary location. When the plugin was extracted to the actual
dirroot with other existing plugin folders present, the method failed
badly.

The solution in the patch is to always extract the ZIP into a temporary
empty location, perform the eventual root renaming there, and only then
move the extracted contents to the final destination. Additionally we
are changing the behaviour of the rename_extracted_rootdir() method so
that now it throws exception if the plugin package contains multiple
root folders (it should not happen in normal situations as such a plugin
would not pass the pre-install validation).

Unit tests did not catch this bug before because in the tests, the
target directory had been empty. Now we are adding a new directory
"aaa_another" to the target location to test in more realistic
environment. Tests for the new behaviour of the renaming method are
added, too.

p.s. I noticed that moodle_exception class was not imported into the
namespace and this is fixed now too (and covered with unit tests).
2016-07-01 01:13:21 +02:00
Russell Smith
1b0b082a08 MDL-54947 database: Update PostgreSQL binary handling.
PostgreSQL 9.1 allows hex formating for binary which is handled better
by pg_query_params().

Getting bytea isn't required on connection, it can be used as pg_field_type()
when binary needs to be checked.
2016-06-30 12:58:53 +10:00
Andrew Nicols
ffcbabcdd0 Merge branch 'MDL-54755_master' of https://github.com/StudiUM/moodle 2016-06-29 15:05:17 +08:00
Andrew Nicols
f9cabe8f99 Merge branch 'wip-mdl-54974' of https://github.com/rajeshtaneja/moodle 2016-06-29 15:05:13 +08:00
Juan Leyva
5b76f88cb5 MDL-54602 webservice: Remove core_grades_update_grades from mobile 2016-06-27 08:44:11 +01:00
Rajesh Taneja
e5f2478b9f MDL-54974 behat: Handle interupts on PHP7
As https://bugs.php.net/bug.php?id=71448 is
not going to get fixed, we need to declare tick
2016-06-27 14:30:58 +08:00
Andrew Nicols
607e900e2d Merge branch 'MDL-54785-master' of git://github.com/FMCorz/moodle 2016-06-27 08:59:49 +08:00
Gilles-Philippe Leblanc
975bd11258 MDL-54755 core: Incorrect redirection after password change 2016-06-23 21:24:29 -04:00
Frederic Massart
df52c272cf
MDL-54785 files: Deprecate the support for $usepost and related 2016-06-23 12:41:03 +08:00
Frederic Massart
4f9b94fdd5
Revert "MDL-44626 files: Show the PHP max upload size instead of 'unlimited'"
This reverts commit 6f0768618a38c11eca90a97c0dff31ec8ce434d1.
2016-06-23 11:51:44 +08:00
Frederic Massart
048f8073d1
Revert "Merge branch 'MDL-54110_master' of https://github.com/marxjohnson/moodle"
This reverts commit 016e0abfbc1992f01eadfdef02de6e56ffad8e9f, reversing
changes made to 58a2f0ac40f24da9c9955110902f8e14cd0d8419.
2016-06-23 11:51:44 +08:00
Frederic Massart
796f86f753
Revert "MDL-54110 repositories: Whitespace, Typo + unit test fixes"
This reverts commit 7e4d43e1a263f7003207a382251de900341db92c.
2016-06-23 11:51:44 +08:00
Simey Lameze
37eafbb6dc MDL-54948 core_files: return false if theres no output from unoconv 2016-06-23 08:37:23 +08:00
Simey Lameze
84440fe3d2 MDL-54948 core_upgrade: fix check_unoconv_version logic 2016-06-22 13:44:48 +08:00
Eloy Lafuente (stronk7)
0f20bf7507 Merge branch 'wip-mdl-54589-mac' of https://github.com/rajeshtaneja/moodle 2016-06-22 01:42:15 +02:00
Eloy Lafuente (stronk7)
e40dd1cdcd MDL-54778 form: Make it all js style (eslint) compliant
The changes in this commit should not be problematic, just:

- different whitespace.
- some docs.
- 1 variable to camelCase.

And then, less trivial, but safe enough IMO:

- a change to camelCase some identifiers and their calculation.
2016-06-22 01:29:51 +02:00
Eloy Lafuente (stronk7)
0f30b4beeb Merge branch 'MDL-54778-master' of git://github.com/andrewnicols/moodle 2016-06-22 01:29:39 +02:00
Dan Poltawski
6a6b0085e0 Merge branch 'MDL-54983-master' of git://github.com/damyon/moodle 2016-06-21 12:56:32 -07:00
Damyon Wiese
0edd7bd7bd MDL-54983 docs: Improve phpdocs for create_user_key
Also fixed the docs for get_user_key.
2016-06-21 12:46:59 -07:00
Eloy Lafuente (stronk7)
e822312af3 Merge branch 'MDL-54939-master' of git://github.com/danpoltawski/moodle 2016-06-21 20:00:36 +02:00
Juan Leyva
833be5e410 MDL-54629 webservice: Change required parameters in external_format_text
component, filearea and itemid are now optional parameters.
In some contexts those parameteres are not necessary because is not
required to do a file rewrite via file_rewrite_pluginfile_urls
2016-06-21 12:16:25 +01:00
Eloy Lafuente (stronk7)
878835db7f Merge branch 'MDL-54948-master' of git://github.com/lameze/moodle 2016-06-21 11:48:10 +02:00
Tobias Reischmann
c05f3109d0 MDL-54892 core: Pass proper parameter for plugin uninstall queries 2016-06-21 09:20:54 +02:00
Andrew Nicols
92e4d84b62 Merge branch 'MDL-51789' of https://github.com/mr-russ/moodle 2016-06-21 14:38:51 +08:00
Russell Smith
5407c5b0f4 MDL-51789 users: Allow picture update from webservices.
useredit_update_picture as moved to user_update_picture
as it's more general.  It was also moved to user/lib.php
so it can be used by both webservices and edit without more include files.
2016-06-21 16:36:53 +10:00
Andrew Nicols
bc341d4f08 Merge branch 'MDL-54920-master' of https://github.com/sammarshallou/moodle 2016-06-21 14:15:41 +08:00
Simey Lameze
6937d89be6 MDL-54948 core_upgrade: fix unoconv check on the environment page 2016-06-21 09:38:01 +08:00
Simey Lameze
9254ba09e8 MDL-54948 core_files: make the check consistent on unoconv test page 2016-06-21 09:36:44 +08:00
Andrew Nicols
c6d20e61e3 Merge branch 'wip-MDL-53399' of https://github.com/JoeyAndres/moodle 2016-06-21 09:03:48 +08:00
Andrew Nicols
da871bb4c1 Merge branch 'wip-MDL-53292-master' of https://github.com/marinaglancy/moodle 2016-06-21 08:46:38 +08:00
Andrew Nicols
badbaa64e3 MDL-54778 form: Fix lots of issues with form dependencies
The original issue here was that each loop of the named values did not
check for prototypal properties. As a result, if there were input fields
with names such as 'sort', 'valueOf', 'constructor', etc. these would
return their prototypal functions instead of a falsy value, and be treated
as though they are array - hence the 'Cannot push to Function' type error.

Following on from this I discovered that the data stores were being created
as arrays, but used as objects. This can also cause issues with some form
input names -- e.g. if they are numeric.

These two issues were resolved together by correctly storing them in
objects, and checking that those objects had real properties
(hasOwnProperty). This itself has to use the prototypal function to cater
for the potential of a field name called 'hasOwnProperty'.

I also found that the instance value stores were being initialised in the
prototype (and therefore shared), which meant that there were numerous
issues if two forms were present on the same page, or one form replaced an
existing one (e.g. forms initialised in JS).

In addition, it also became apparant that several values were being used
outside of scope, or in the wrong scope. This caused further issues when
creating multiple forms on a page.
2016-06-21 07:58:13 +08:00
Rajesh Taneja
fba0ac63b8 MDL-54589 behat: Added hack for some OS/browsers 2016-06-20 16:03:36 +08:00
Rajesh Taneja
3aaf98f62c MDL-54589 behat: Trigger change event after selecting option
After selecting option, some browsers need
explicit change event
2016-06-20 09:43:08 +08:00