Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mahara
mahara
Commits
61e272c7
Commit
61e272c7
authored
Aug 28, 2018
by
Cecilia Vela Gurovic
Committed by
Gerrit Code Review
Aug 28, 2018
Browse files
Merge "Bug 1788710: Altering db upgrade step to avoid unrelated 'tags' error"
parents
aebe9e61
a6c082d3
Changes
1
Hide whitespace changes
Inline
Side-by-side
htdocs/lib/db/upgrade.php
View file @
61e272c7
...
...
@@ -881,19 +881,20 @@ function xmldb_core_upgrade($oldversion=0) {
foreach
(
$instances
as
$instance
)
{
$blockinstance
=
new
BlockInstance
(
$instance
->
id
);
$configdata
=
$blockinstance
->
get
(
'configdata'
);
// We don't want to do the normal commit() here as plan blocks have associated artefacts
// and this can clash with the 'artefact_tag' to 'tag' change
// As we have not changed which artefacts are attached but only how the configdata is stored
// we will save the new configdata back direct to database instead.
if
(
isset
(
$configdata
[
'artefactid'
]))
{
$configdata
[
'artefactids'
]
=
array
(
$configdata
[
'artefactid'
]);
unset
(
$configdata
[
'artefactid'
]);
$blockinstance
->
set
(
'configdata'
,
$configdata
);
$blockinstance
->
commit
();
}
else
if
(
is_null
(
$configdata
[
'artefactid'
]))
{
$configdata
[
'artefactids'
]
=
array
();
unset
(
$configdata
[
'artefactid'
]);
$blockinstance
->
set
(
'configdata'
,
$configdata
);
$blockinstance
->
commit
();
}
$configdata
=
serialize
(
$configdata
);
execute_sql
(
"UPDATE
{
block_instance
}
SET configdata = ? WHERE id = ?"
,
array
(
$configdata
,
$instance
->
id
));
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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