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
e5fe80d5
Commit
e5fe80d5
authored
Oct 17, 2008
by
Richard Mansfield
Browse files
Allow check_plugin_sanity to succeed when an artefact type moves from one plugin to another
parent
62fa55e7
Changes
2
Hide whitespace changes
Inline
Side-by-side
htdocs/artefact/lib.php
View file @
e5fe80d5
...
...
@@ -760,7 +760,12 @@ function artefact_check_plugin_sanity($pluginname) {
if
(
get_config
(
'installed'
))
{
if
(
$taken
=
get_record_select
(
'artefact_installed_type'
,
'name = ? AND plugin != ?'
,
array
(
$type
,
$pluginname
)))
{
throw
new
InstallationException
(
get_string
(
'artefacttypenametaken'
,
'error'
,
$type
,
$taken
->
plugin
));
// Check the other plugin's code in case the duplicate type is being removed from it at the same time
$otherclass
=
generate_class_name
(
'artefact'
,
$taken
->
plugin
);
safe_require
(
'artefact'
,
$taken
->
plugin
);
if
(
in_array
(
$type
,
call_static_method
(
$otherclass
,
'get_artefact_types'
)))
{
throw
new
InstallationException
(
get_string
(
'artefacttypenametaken'
,
'error'
,
$type
,
$taken
->
plugin
));
}
}
}
if
(
!
class_exists
(
$typeclassname
))
{
...
...
htdocs/lib/db/upgrade.php
View file @
e5fe80d5
...
...
@@ -1403,8 +1403,10 @@ function xmldb_core_upgrade($oldversion=0) {
$profileicons
=
get_column
(
'artefact'
,
'id'
,
'artefacttype'
,
'profileicon'
);
if
(
$profileicons
)
{
foreach
(
$profileicons
as
$a
)
{
$size
=
filesize
(
$artefactdata
.
'file/profileicons/originals/'
.
(
$a
%
256
)
.
'/'
.
$a
);
insert_record
(
'artefact_file_files'
,
(
object
)
array
(
'artefact'
=>
$a
,
'fileid'
=>
$a
,
'size'
=>
$size
));
$filesize
=
filesize
(
$artefactdata
.
'file/profileicons/originals/'
.
(
$a
%
256
)
.
'/'
.
$a
);
$imagesize
=
getimagesize
(
$artefactdata
.
'file/profileicons/originals/'
.
(
$a
%
256
)
.
'/'
.
$a
);
insert_record
(
'artefact_file_files'
,
(
object
)
array
(
'artefact'
=>
$a
,
'fileid'
=>
$a
,
'size'
=>
$filesize
));
insert_record
(
'artefact_file_image'
,
(
object
)
array
(
'artefact'
=>
$a
,
'width'
=>
$imagesize
[
0
],
'height'
=>
$imagesize
[
1
]));
}
}
}
...
...
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