Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
moodle_mod-hvp
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
elc
moodle_mod-hvp
Commits
1b83a028
Commit
1b83a028
authored
6 years ago
by
Dan Marsden
Browse files
Options
Downloads
Patches
Plain Diff
Fix #242 check if moodleform_mod class has a get_data method
If not, clean up the data manually.
parent
f00824d4
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
mod_form.php
+11
-5
11 additions, 5 deletions
mod_form.php
with
11 additions
and
5 deletions
mod_form.php
+
11
−
5
View file @
1b83a028
...
@@ -364,7 +364,7 @@ class mod_hvp_mod_form extends moodleform_mod {
...
@@ -364,7 +364,7 @@ class mod_hvp_mod_form extends moodleform_mod {
/**
/**
* This should not be overridden, but we have to in order to support Moodle <3.2
* This should not be overridden, but we have to in order to support Moodle <3.2
*
(Do not override this method, override data_postprocessing() instead.)
*
and older Totara sites.
*
*
* Moodle 3.1 LTS is supported until May 2019, after that this can be dropped.
* Moodle 3.1 LTS is supported until May 2019, after that this can be dropped.
* (could cause issues for new features if they add more to this in Core)
* (could cause issues for new features if they add more to this in Core)
...
@@ -372,11 +372,17 @@ class mod_hvp_mod_form extends moodleform_mod {
...
@@ -372,11 +372,17 @@ class mod_hvp_mod_form extends moodleform_mod {
* @return object submitted data; NULL if not valid or not submitted or cancelled
* @return object submitted data; NULL if not valid or not submitted or cancelled
*/
*/
public
function
get_data
()
{
public
function
get_data
()
{
global
$CFG
;
$data
=
parent
::
get_data
();
$data
=
parent
::
get_data
();
// Check if Moodle version is < 3.2
if
(
$CFG
->
version
<
2016120500
)
{
if
(
$data
)
{
if
(
$data
)
{
// Check if moodleform_mod class has already taken care of the data for us.
// If not this is an older Moodle or Totara site that we need to treat differently.
$class
=
new
ReflectionClass
(
'moodleform_mod'
);
$method
=
$class
->
getMethod
(
'get_data'
);
if
(
$method
->
class
!==
'moodleform_mod'
)
{
// Moodleform_mod class doesn't override get_data so we need to convert it ourselves.
// Convert the grade pass value - we may be using a language which uses commas,
// Convert the grade pass value - we may be using a language which uses commas,
// rather than decimal points, in numbers. These need to be converted so that
// rather than decimal points, in numbers. These need to be converted so that
// they can be added to the DB.
// they can be added to the DB.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment