Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
integration
prechecker
Commits
c26b7f0c
Commit
c26b7f0c
authored
Mar 01, 2011
by
Tim Hunt
Browse files
MDL-20636 Fix upgrade problems. Thanks to James Brisland for his help.
parent
7916ea12
Changes
3
Hide whitespace changes
Inline
Side-by-side
local/qedatabase/db/install.php
View file @
c26b7f0c
...
...
@@ -485,7 +485,7 @@ function xmldb_local_qedatabase_install() {
// for now. We will fill in the appropriate behaviour name when
// updating all the rest of the attempt data.
$field
=
new
xmldb_field
(
'preferredbehaviour'
);
$field
->
set_attributes
(
XMLDB_TYPE_CHAR
,
'32'
,
null
,
null
,
null
,
null
,
null
,
'to_be_set_later'
,
'component'
);
$field
->
set_attributes
(
XMLDB_TYPE_CHAR
,
'32'
,
null
,
XMLDB_NOTNULL
,
null
,
'to_be_set_later'
,
'component'
);
$dbman
->
add_field
(
$table
,
$field
);
// Then remove the default value, now the column is populated.
...
...
mod/quiz/report/statistics/db/upgrade.php
View file @
c26b7f0c
...
...
@@ -266,8 +266,13 @@ function xmldb_quiz_statistics_upgrade($oldversion) {
}
if
(
$oldversion
<
2011021500
)
{
$DB
->
set_field
(
'quiz_reports'
,
'capability'
,
'quiz/statistics:view'
,
array
(
'name'
=>
'statistics'
));
if
(
$dbman
->
table_exists
(
'quiz_reports'
))
{
$DB
->
set_field
(
'quiz_reports'
,
'capability'
,
'quiz/statistics:view'
,
array
(
'name'
=>
'statistics'
));
}
else
{
$DB
->
set_field
(
'quiz_report'
,
'capability'
,
'quiz/statistics:view'
,
array
(
'name'
=>
'statistics'
));
}
// statistics savepoint reached
upgrade_plugin_savepoint
(
true
,
2011021500
,
'quiz'
,
'statistics'
);
...
...
question/type/match/db/upgrade.php
View file @
c26b7f0c
...
...
@@ -111,7 +111,7 @@ function xmldb_qtype_match_upgrade($oldversion) {
// Define field partiallycorrectfeedback to be added to question_match
$table
=
new
xmldb_table
(
'question_match'
);
$field
=
new
xmldb_field
(
'partiallycorrectfeedback'
,
XMLDB_TYPE_TEXT
,
'small'
,
null
,
XMLDB_NOTNULL
,
null
,
''
,
'correctfeedbackformat'
);
$field
=
new
xmldb_field
(
'partiallycorrectfeedback'
,
XMLDB_TYPE_TEXT
,
'small'
,
null
,
null
,
null
,
null
,
'correctfeedbackformat'
);
// Conditionally launch add field partiallycorrectfeedback
if
(
!
$dbman
->
field_exists
(
$table
,
$field
))
{
...
...
@@ -148,7 +148,7 @@ function xmldb_qtype_match_upgrade($oldversion) {
// Define field incorrectfeedback to be added to question_match
$table
=
new
xmldb_table
(
'question_match'
);
$field
=
new
xmldb_field
(
'incorrectfeedback'
,
XMLDB_TYPE_TEXT
,
'small'
,
null
,
XMLDB_NOTNULL
,
null
,
null
,
'partiallycorrectfeedbackformat'
);
$field
=
new
xmldb_field
(
'incorrectfeedback'
,
XMLDB_TYPE_TEXT
,
'small'
,
null
,
null
,
null
,
null
,
'partiallycorrectfeedbackformat'
);
// Conditionally launch add field incorrectfeedback
if
(
!
$dbman
->
field_exists
(
$table
,
$field
))
{
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment