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
4ac07636
Commit
4ac07636
authored
Feb 23, 2009
by
Nigel McNie
Browse files
Unconditionally update artefact type for profile icons.
Prevents upgrade crash when there's no profile icons in the system.
parent
f8fa229c
Changes
1
Hide whitespace changes
Inline
Side-by-side
htdocs/lib/db/upgrade.php
View file @
4ac07636
...
@@ -619,15 +619,16 @@ function xmldb_core_upgrade($oldversion=0) {
...
@@ -619,15 +619,16 @@ function xmldb_core_upgrade($oldversion=0) {
if
(
$oldversion
<
2008101602
)
{
if
(
$oldversion
<
2008101602
)
{
// Move artefact/internal/profileicons directory to artefact/file
// Move artefact/internal/profileicons directory to artefact/file
set_field
(
'artefact_installed_type'
,
'plugin'
,
'file'
,
'name'
,
'profileicon'
);
set_field
(
'artefact_config'
,
'plugin'
,
'file'
,
'field'
,
'profileiconwidth'
);
set_field
(
'artefact_config'
,
'plugin'
,
'file'
,
'field'
,
'profileiconheight'
);
$artefactdata
=
get_config
(
'dataroot'
)
.
'artefact/'
;
$artefactdata
=
get_config
(
'dataroot'
)
.
'artefact/'
;
if
(
is_dir
(
$artefactdata
.
'internal/profileicons'
))
{
if
(
is_dir
(
$artefactdata
.
'internal/profileicons'
))
{
if
(
!
is_dir
(
$artefactdata
.
'file'
))
{
if
(
!
is_dir
(
$artefactdata
.
'file'
))
{
mkdir
(
$artefactdata
.
'file'
);
mkdir
(
$artefactdata
.
'file'
);
}
}
rename
(
$artefactdata
.
'internal/profileicons'
,
$artefactdata
.
'file/profileicons'
);
rename
(
$artefactdata
.
'internal/profileicons'
,
$artefactdata
.
'file/profileicons'
);
set_field
(
'artefact_installed_type'
,
'plugin'
,
'file'
,
'name'
,
'profileicon'
);
set_field
(
'artefact_config'
,
'plugin'
,
'file'
,
'field'
,
'profileiconwidth'
);
set_field
(
'artefact_config'
,
'plugin'
,
'file'
,
'field'
,
'profileiconheight'
);
// Insert artefact_file_files records for all profileicons
// Insert artefact_file_files records for all profileicons
$profileicons
=
get_column
(
'artefact'
,
'id'
,
'artefacttype'
,
'profileicon'
);
$profileicons
=
get_column
(
'artefact'
,
'id'
,
'artefacttype'
,
'profileicon'
);
...
...
Write
Preview
Supports
Markdown
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