1419 Commits

Author SHA1 Message Date
Brendan Heywood
462065e822 MDL-51718 weblib: Allow moodle_url scheme to be set 2015-11-05 09:08:00 +11:00
Eloy Lafuente (stronk7)
217c3e0fc9 Merge branch 'wip-mdl-52007' of https://github.com/rajeshtaneja/moodle 2015-11-03 17:56:23 +01:00
rajesh Taneja
180fdb2f7c MDL-52007 behat: Use extended timeout for site admin expansion 2015-11-03 16:08:27 +08:00
Jun Pataleta
bbbdfc8610 MDL-47073 lib: Replace backslashes with slashes in jquery plugin urls
This patch replaces backslash characters in the generated jQuery
plugin URL to forward slashes when slasharguments is disabled and
 the Moodle server is running on IIS.
Thanks to Ryan Panning <Ryan.Panning@district196.org> for
reporting this issue and for suggesting a fix.
2015-10-30 17:05:23 -05:00
Andrew Nicols
37d0021369 Merge branch 'MDL-51915' of git://github.com/timhunt/moodle 2015-10-29 14:41:45 +08:00
Eloy Lafuente (stronk7)
7c549a17f4 MDL-51893 core_date: Stop using Pacific/Norfolk as 11.5 replacement
Norfolk Island's standard time (NFT) was on UTC+11:30 until 4 October
2015, when it was changed to UTC+11:00. So it's not suitable for 11.5
bad mapping replacement anymore.

It seems that there isn't any other location using such 11.5 timezone
so completely getting rid of it for conversions.
2015-10-27 10:17:05 +01:00
Tim Hunt
42406bc413 MDL-51915 lib tests: Extra unit test for html_to_text. 2015-10-26 18:30:21 +00:00
Dan Poltawski
0a05907873 Merge branch 'MDL-51737-master-3' of git://github.com/andrewnicols/moodle 2015-10-22 14:43:20 +01:00
Andrew Nicols
39a731efb4 MDL-51737 core: Add Edge UserAgent support 2015-10-22 08:37:27 +08:00
Eloy Lafuente (stronk7)
9062fa25ae Merge branch 'MDL-49329-master-multiplug' of git://github.com/mudrd8mz/moodle 2015-10-19 18:10:40 +02:00
David Mudrák
c8a6d162a0 MDL-51832 tests: Fix failing code manager unit tests on Windows 2015-10-19 18:08:59 +02:00
Dan Poltawski
e926ee8cf1 MDL-49329 fixtures: remove trailing whitespace 2015-10-16 15:22:37 +01:00
Dan Poltawski
293197afb3 Merge branch 'MDL-49329-master-multiplug' of git://github.com/mudrd8mz/moodle 2015-10-16 14:53:26 +01:00
Dan Poltawski
05ed945e61 Merge branch 'wip-mdl-50940' of https://github.com/rajeshtaneja/moodle 2015-10-15 08:58:23 +01:00
Andrew Nicols
56bd244634 Merge branch 'MDL-51756-master' of git://github.com/damyon/moodle 2015-10-15 15:22:37 +08:00
Andrew Nicols
8413376088 MDL-51756 tests: Refactor test to use data-provider
The benefit is that this becomes one test per external function instead of one
test testing them all - so more information is shown on failure and we get lots
more dots (we love dots!).
2015-10-15 15:17:02 +08:00
Damyon Wiese
1dc4dc989d MDL-51756 externallib: Show debugging when optional params are wrong
Optional params are not allowed as the top level value for external_function_parameters.
This is because stricter protocols (xmlrpc and soap) cannot handle optional parameters, only
optional properties in a structure.
2015-10-15 14:19:07 +08:00
Andrew Nicols
44250050dc MDL-51524 tests: Fix broken tests
The upgraded version of HTML2Text highlighted some bugs in our unit tests.

In the IOS test, the HTML content includes a couple of patches of &nbsp;
In the previous version of HTML2Text, these were being converted to
breaking spaces. In one of these cases, it was then removed due to a trim.
The expected texts have been converted to use the correct non-breaking spaces.
In the case of the trimmed one, it is no longer trimmed as non-breaking
spaces are not trimmed.
This gives a truer reflection of the actual text.

In the case of the Outlook test, this trailing whitespace is not present in
the source. It was likely caused by a bug in the previous version of
HTML2Text.

In the case of the weblib change, the test was just wrong. Both of the
actual characters are encodings for an HTML bullet (decimal and hex) and
should both be converted to the relevant UTF8 representation of this
bullet.
2015-10-12 09:35:59 +08:00
Andrew Nicols
ec2d33dfcd MDL-51524 libraries: Update to latest version of html2text
We were previously using an ancient version of html2text from RoundCube
with many customisations.

This patchset moves to the version included in the latest version of
HTML2Text, and wraps the library in a moodle-provided class. This
moves all previous hacks away from that class.

Unfortunately, two hacks still remain - two of the functions in the
RoundCube class are private, and must be modified to protected in order to
use the class effectively.
2015-10-12 09:35:58 +08:00
David Mudrák
30c264211e MDL-49329 admin: Fix reported coding style warnings 2015-10-10 09:15:27 +02:00
David Mudrák
80c3c6501d MDL-49329 admin: Clean up code manager methods
The method move_plugin_directory() was a relict from previous 2.9
implementation within tool_installadon_installer and was originally
supposed to be used to move whole plugin folders. The archiving feature
has been finally implemented via using zip files (so that we do not have
actual PHP code present in the dataroot) and we do not need this method.
2015-10-09 14:43:33 +02:00
David Mudrák
a2e1e0d0f1 MDL-49329 admin: Archive plugin code before removing it from dirroot
This should allow the admin to revert the upgrade of existing plugins,
such when the dependency chain leads to a dead-end. Additionally, we
archive (as a last-chance copy) the to-be-installed plugins when
cancelling their installation. This is mainly for developers who could
otherwise loose their code. For the same reason, plugins are being
archived upon uninstallation, too.
2015-10-09 14:33:47 +02:00
David Mudrák
2d00be61f1 MDL-49329 admin: Make plugin manager able to install from local zips too
The plugin manager's method install_remote_plugins() has been changed to
install_plugins() and it is now able to install plugins from the
provided list of locally available ZIP files, too. This is used by the
Install plugins admin tool.
2015-10-09 09:50:46 +02:00
David Mudrák
8acee4b53d MDL-49329 admin: Improve the plugin package validator
Previously, the validator was used for installation of the new plugins
only. We now validate every incoming plugin package. As a result, we
must no longer insists on the target location is empty. Instead, warning
is raised.
2015-10-08 23:32:05 +02:00
David Mudrák
fd2d146218 MDL-49329 admin: Validate the contents of the cached plugin ZIP package 2015-10-08 23:32:05 +02:00
David Mudrák
4f18a4e60c MDL-49329 admin: Introduce new \core\update\remote_info class
This is just a thin wrapper for normal objects, allowing us to have
explicit type hinting / declarations in method signatures.
2015-10-08 23:32:05 +02:00
David Mudrák
cc5bc55ead MDL-49329 admin: Add core_plugin_manager::available_updates() method
The new method is going to be used to support the "Update all plugins"
feature.
2015-10-08 23:32:04 +02:00
David Mudrák
d22835216f MDL-49329 admin: Clean up core_plugin unit tests
As a first step for removing the \core\update\deployer and mdeploy.php,
this patch fixes existing tests.
2015-10-08 23:32:04 +02:00
David Mudrák
4441d5e5fb MDL-49329 admin: Fix report on required core version in missing plugins
If the plugin was missing from disk, the required core version was
displayed as "Moodle {$a}" because the core dependency resolver always
returns an object.
2015-10-08 23:32:04 +02:00
David Mudrák
35f2b67442 MDL-49329 admin: Fix the API for getting remote plugin info
The previous version of the plugin manager's method
get_remote_plugin_info() was suitable for installing missing
dependencies only. To make use of for installing new plugins and/or
available updates, it must be clear that we are requesting information
for the particular plugin version only, not "given or higher" version.
2015-10-08 23:32:04 +02:00
David Mudrák
d6e38c2a9d MDL-49329 admin: Validate pluginfo service response
The new client's method makes sure that the returned data structure has
expected format so that the plugin manager can safely rely on it.
2015-10-08 23:32:04 +02:00
David Mudrák
f2d8ed45e3 MDL-49329 admin: Introduce new \core\update\validator class
This is not really new class. Originally, the validator was implemented
in the scope of the tool_installaddon plugin. But we need its features
in other parts at the core level (e.g. during the upgrade to validate
available missing dependencies or available updates). Looking back, it
was a mistake to have it implemented at the plugin level rather than the
core level.

So this patch moves the tool_installaddon_validator class to
\core\update\validator class, together with associated unit tests,
fixture files and strings. There were changes made in the
tool_installaddon to make use of this new class instead of the old one.

This is a great step towards the bright future, hopefully there won't be
many regressions.

AMOS BEGIN
 MOV [validationmsg_componentmatch,tool_installaddon],[validationmsg_componentmatch,core_plugin]
 MOV [validationmsg_componentmismatchname,tool_installaddon],[validationmsg_componentmismatchname,core_plugin]
 MOV [validationmsg_componentmismatchname_help,tool_installaddon],[validationmsg_componentmismatchname_help,core_plugin]
 MOV [validationmsg_componentmismatchname_info,tool_installaddon],[validationmsg_componentmismatchname_info,core_plugin]
 MOV [validationmsg_componentmismatchtype,tool_installaddon],[validationmsg_componentmismatchtype,core_plugin]
 MOV [validationmsg_componentmismatchtype_info,tool_installaddon],[validationmsg_componentmismatchtype_info,core_plugin]
 MOV [validationmsg_filenotexists,tool_installaddon],[validationmsg_filenotexists,core_plugin]
 MOV [validationmsg_filesnumber,tool_installaddon],[validationmsg_filesnumber,core_plugin]
 MOV [validationmsg_filestatus,tool_installaddon],[validationmsg_filestatus,core_plugin]
 MOV [validationmsg_filestatus_info,tool_installaddon],[validationmsg_filestatus_info,core_plugin]
 MOV [validationmsg_foundlangfile,tool_installaddon],[validationmsg_foundlangfile,core_plugin]
 MOV [validationmsg_maturity,tool_installaddon],[validationmsg_maturity,core_plugin]
 MOV [validationmsg_maturity_help,tool_installaddon],[validationmsg_maturity_help,core_plugin]
 MOV [validationmsg_missingcomponent,tool_installaddon],[validationmsg_missingcomponent,core_plugin]
 MOV [validationmsg_missingcomponent_help,tool_installaddon],[validationmsg_missingcomponent_help,core_plugin]
 MOV [validationmsg_missingcomponent_link,tool_installaddon],[validationmsg_missingcomponent_link,core_plugin]
 MOV [validationmsg_missingexpectedlangenfile,tool_installaddon],[validationmsg_missingexpectedlangenfile,core_plugin]
 MOV [validationmsg_missingexpectedlangenfile_info,tool_installaddon],[validationmsg_missingexpectedlangenfile_info,core_plugin]
 MOV [validationmsg_missinglangenfile,tool_installaddon],[validationmsg_missinglangenfile,core_plugin]
 MOV [validationmsg_missinglangenfolder,tool_installaddon],[validationmsg_missinglangenfolder,core_plugin]
 MOV [validationmsg_missingversion,tool_installaddon],[validationmsg_missingversion,core_plugin]
 MOV [validationmsg_missingversionphp,tool_installaddon],[validationmsg_missingversionphp,core_plugin]
 MOV [validationmsg_multiplelangenfiles,tool_installaddon],[validationmsg_multiplelangenfiles,core_plugin]
 MOV [validationmsg_onedir,tool_installaddon],[validationmsg_onedir,core_plugin]
 MOV [validationmsg_onedir_help,tool_installaddon],[validationmsg_onedir_help,core_plugin]
 MOV [validationmsg_pathwritable,tool_installaddon],[validationmsg_pathwritable,core_plugin]
 MOV [validationmsg_pluginversion,tool_installaddon],[validationmsg_pluginversion,core_plugin]
 MOV [validationmsg_release,tool_installaddon],[validationmsg_release,core_plugin]
 MOV [validationmsg_requiresmoodle,tool_installaddon],[validationmsg_requiresmoodle,core_plugin]
 MOV [validationmsg_rootdir,tool_installaddon],[validationmsg_rootdir,core_plugin]
 MOV [validationmsg_rootdir_help,tool_installaddon],[validationmsg_rootdir_help,core_plugin]
 MOV [validationmsg_rootdirinvalid,tool_installaddon],[validationmsg_rootdirinvalid,core_plugin]
 MOV [validationmsg_rootdirinvalid_help,tool_installaddon],[validationmsg_rootdirinvalid_help,core_plugin]
 MOV [validationmsg_targetexists,tool_installaddon],[validationmsg_targetexists,core_plugin]
 MOV [validationmsg_targetexists_help,tool_installaddon],[validationmsg_targetexists_help,core_plugin]
 MOV [validationmsg_unknowntype,tool_installaddon],[validationmsg_unknowntype,core_plugin]
 MOV [validationmsg_versionphpsyntax,tool_installaddon],[validationmsg_versionphpsyntax,core_plugin]
 MOV [validationmsglevel_debug,tool_installaddon],[validationmsglevel_debug,core_plugin]
 MOV [validationmsglevel_error,tool_installaddon],[validationmsglevel_error,core_plugin]
 MOV [validationmsglevel_info,tool_installaddon],[validationmsglevel_info,core_plugin]
 MOV [validationmsglevel_warning,tool_installaddon],[validationmsglevel_warning,core_plugin]
AMOS END
2015-10-08 23:32:03 +02:00
David Mudrák
0e442ee776 MDL-49329 admin: Introduce new \core\update\core_manager tool
The plan is to have a single tool looking after all operations with
plugin ZIP packages (downloading, unzipping, moving to the dirroot and
back). For legacy reasons, we have that logic currently duplicated in
mdeploy and tool_installaddon. I would like to unify and simplify the
whole machinery to use the same code for available updates, manual
installation and plugin dependencies.
2015-10-08 23:32:03 +02:00
David Mudrák
5a92cd0b8d MDL-49329 admin: Display missing dependencies on plugins check screen
The patch improves the dependencies resolution in the plugin manager so
that the information about availability of the missing dependency is
included and can be displayed at the Plugins check screen during the
upgrade.
2015-10-08 23:32:03 +02:00
David Mudrák
48900324b3 MDL-49329 admin: Introduce new \core\update\api client class
The purpose of this class is to provide a general client for all APIs
available at https://download.moodle.org/api/ (e.g. available updates,
plugin info, plugins list etc). Currently, fetching data from this API
is done separately at several places. This leads to code duplication and
harder maintenance (I know it well).

Additionally, the existing client was implemented as
tool_installaddon_pluginfo_client in the admin/tool/installaddon/ scope.
I will soon need to use the same functionality in the
core_plugin_manager and it would hurt my karma if the core was depending
on a class provided by a admin tool plugin (even if it is standard one).

So, there is new \core\update\api client implementing the version 1.3 of
the pluginfo API. There is a TODO note left for remaining services.
2015-10-08 23:32:03 +02:00
David Mudrák
c44bbe35bf MDL-49329 admin: Improve loading of available updates info
The actual loading of available updates info objects is moved back to
the plugin manager class. As we can now mockup the manager in unit
tests, this allows us to bypass the real \core\update\checker and have
unit tests for \core\plugininfo\base::available_updates().
2015-10-08 23:32:02 +02:00
David Mudrák
2d488c8f01 MDL-49329 admin: Keep reference to plugin manager in plugininfo objects
Plugin info objects are owned by the plugin manager (composition
pattern). Even if the plugin manager is a singleton, we need to keep
explicit reference to the plugin manager that owns the plugin info so
that we can mock up things in unit tests.

Therefore this patch introduces a new property of plugin info objects
that holds the reference to the instance of the plugin manager that made
(and hence owns) the given info instance.

The only trouble here is with static methods of plugin info classes such
as \core\plugininfo\base::get_enabled_plugins(). In these cases, the
code keeps using the core_plugin_manager singleton. The solution would
be to pass the plugin manager instance as a parameter but that is not
worth of change for now, IMHO.
2015-10-08 23:32:02 +02:00
David Mudrák
361feecdcf MDL-49329 admin: Make core_plugin_manager better suited for unit testing
We can now override the plugin manager's methods in the testable
subclass while still keeping the singleton behaviour of it. The change
makes use of late static binding.
2015-10-08 23:32:02 +02:00
David Monllao
dc9afaba4f MDL-51623 core_event: Updating error messages 2015-10-08 15:57:46 +08:00
David Monllao
02c85f9934 Merge branch 'MDL-51623_parent_event' of git://github.com/moodlerooms/moodle 2015-10-08 15:53:00 +08:00
Marina Glancy
5667e60249 MDL-41042 coursecat: reset course contacts cache more often 2015-10-07 10:23:03 +08:00
Mark Nielsen
2df73956b8 MDL-51623 core_event: Allow observation of parent events 2015-10-02 08:45:31 -07:00
Eloy Lafuente (stronk7)
c75b891ba7 Merge branch 'MDL-49821-master-master' of git://github.com/jleyva/moodle 2015-10-01 01:26:58 +02:00
Eloy Lafuente (stronk7)
9fb434a618 Merge branch 'wip-mdl-51266' of https://github.com/rajeshtaneja/moodle 2015-09-30 20:34:33 +02:00
Juan Leyva
3961ebfbc0 MDL-49821 core_user: New function for checking if a user is active 2015-09-25 11:33:13 +02:00
rajesh Taneja
267033a979 MDL-50940 behat: Added support for field matching with xpath 2015-09-24 13:00:15 +08:00
rajesh Taneja
5ecf8e8f21 MDL-51266 unittest: replaced low level phpunit_util calls 2015-09-23 15:42:48 +08:00
Andrew Hancox
d9fddb0bc6 MDL-50940 behat: Added ability to check field value by xpath 2015-09-23 12:45:00 +08:00
Eloy Lafuente (stronk7)
201a26bbaa Merge branch 'MDL-47494' of git://github.com/timhunt/moodle
Note: Fixed some minor grunt and EOF whitespace issues while merging.
2015-09-22 18:38:27 +02:00
Dan Poltawski
b3e959497e Merge branch 'wip-MDL-50917-master' of git://github.com/abgreeve/moodle 2015-09-22 09:15:57 +01:00