This is the same situation as was in MDL-56864 but now in 'course', 'autocomplete' and 'select' elements
- if the element allows multiple selection it is impossible to remove the last element
Forms subsystem has no own database table. The only personal data is the
user preference 'filemanager_recentviewmode' that stores the view mode
of the file picker element.
It was discussed whether handling of this preference should be added
here into core_form, or rather into core_repository subsystem. The final
decision was to consider the preference as owned by the core_form
because it is affecting the display of a form element, not the
repository backend (even though the strings describing it had been put
into core_repository strings).
These tests are an abuse and should not have been accepted. Behat tests should use real pages.
Adding testing only entry points to Moodle is a bad security practice and is not the purpose of behat.
The patch adds an extra validation step against accepted file types.
Even if the repository checks are bypassed (as illustrated in the
Behat), the invalid file is still caught by the element's validation
rules.
It turns out there is no way to test the filepicker element easily via
Behat. Additionally, it provides the renaming features only with
disabled javascript. So the Behat tests are provided for the filemanager
only.
AMOS BEGIN
CPY [err_wrongfileextension,mod_workshop],[err_wrongfileextension,core_form]
AMOS END
While working on the filetypes element validation, I realized we did not
cover the case of selecting 'Any file type'. So the value '*' was
falsely reported as unknown file type.
These new methods will be used to render the tree of file types groups
and extensions in the browser widget.
Co-Authored-By: John Okely <john@moodle.com>
This was affecting both to rateable (forum...) and not rateable
(assignment...) activities. So tests have been completed to verify
that now saving is performed and the correct scale values stored.
This patch replaces all homegrown timezone
stuff with standard PHP date/time code.
The main change is the introduction of core_date
class that returns normalised user and server
timezones. From now on nobody should be using
$CFG->timezone or $user->timezone directly!
Other new features and fixes:
* admins are prompted for timezone during install
* editing of other users is finally fixed
* timezones are displayed in user profile
* new $this->setTimezone() in phpunit
* time locale is now automatically reset in phpunit
* timezone is now automatically reset in phpunit
* phpunit has Australia/Perth as default timezone
Includes:
* constants refactoring
* reworked db table init
* support for $CFG->debug = -1
* functional DB tests
* fixed $DB->get_indexes() to not throw exceptions when table does not exist
* fix handling of user passwords in test db
* add debug info to exception messages
* removed unnecessary PHP debug errors from mathslib
* fixed @error suppression in get_string
* fixed PHPUnit error handler setup
* added timezone info to default install