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
34402867
Commit
34402867
authored
May 15, 2015
by
Aaron Wells
Browse files
Bug 1455122: Missing block plugin causes upgrade to crash
Change-Id: I607830471cd4ffe2555421b05a2e99eabf74bb06
parent
19f5a685
Changes
2
Hide whitespace changes
Inline
Side-by-side
htdocs/lib/db/upgrade.php
View file @
34402867
...
@@ -4011,10 +4011,6 @@ function xmldb_core_upgrade($oldversion=0) {
...
@@ -4011,10 +4011,6 @@ function xmldb_core_upgrade($oldversion=0) {
log_debug
(
"Update block categories for plugins"
);
log_debug
(
"Update block categories for plugins"
);
if
(
$blocktypes
=
plugins_installed
(
'blocktype'
,
true
))
{
if
(
$blocktypes
=
plugins_installed
(
'blocktype'
,
true
))
{
foreach
(
$blocktypes
as
$bt
)
{
foreach
(
$blocktypes
as
$bt
)
{
// Hack to deal with contactinfo block deletion
if
(
$bt
->
name
==
'contactinfo'
)
{
continue
;
}
install_blocktype_categories_for_plugin
(
blocktype_single_to_namespaced
(
$bt
->
name
,
$bt
->
artefactplugin
));
install_blocktype_categories_for_plugin
(
blocktype_single_to_namespaced
(
$bt
->
name
,
$bt
->
artefactplugin
));
}
}
}
}
...
...
htdocs/lib/upgrade.php
View file @
34402867
...
@@ -1125,7 +1125,10 @@ function get_blocktype_categories() {
...
@@ -1125,7 +1125,10 @@ function get_blocktype_categories() {
}
}
function
install_blocktype_categories_for_plugin
(
$blocktype
)
{
function
install_blocktype_categories_for_plugin
(
$blocktype
)
{
safe_require
(
'blocktype'
,
$blocktype
);
if
(
!
safe_require
(
'blocktype'
,
$blocktype
,
'lib.php'
,
'require_once'
,
true
))
{
// Block has been uninstalled or is missing, so no category data to enter.
return
;
}
$blocktype
=
blocktype_namespaced_to_single
(
$blocktype
);
$blocktype
=
blocktype_namespaced_to_single
(
$blocktype
);
$catsinstalled
=
get_column
(
'blocktype_category'
,
'name'
);
$catsinstalled
=
get_column
(
'blocktype_category'
,
'name'
);
db_begin
();
db_begin
();
...
...
Aaron Wells
@aaronw
mentioned in commit
17e01546
·
May 27, 2015
mentioned in commit
17e01546
mentioned in commit 17e0154633ba9ec737f50913f6dd3d51c89f25e2
Toggle commit list
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