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
moodle
moodle
Commits
f3a3e234
Commit
f3a3e234
authored
Aug 29, 2017
by
Ankit Agarwal
Browse files
MDL-57115 blocks: Cleanup block_messages instances and other configs
parent
898ba89b
Changes
4
Hide whitespace changes
Inline
Side-by-side
blocks/upgrade.txt
View file @
f3a3e234
...
@@ -9,6 +9,7 @@ information provided here is intended especially for developers.
...
@@ -9,6 +9,7 @@ information provided here is intended especially for developers.
* Blocks can now be included in Moodle global search, with some limitations (at present, the search
* Blocks can now be included in Moodle global search, with some limitations (at present, the search
works only for blocks located directly on course pages or site home page). See the HTML block for
works only for blocks located directly on course pages or site home page). See the HTML block for
an example.
an example.
* Block block_messages is no longer a part of core.
=== 3.3 ===
=== 3.3 ===
...
...
lib/classes/plugin_manager.php
View file @
f3a3e234
...
@@ -1647,7 +1647,7 @@ class core_plugin_manager {
...
@@ -1647,7 +1647,7 @@ class core_plugin_manager {
$plugins
=
array
(
$plugins
=
array
(
'qformat'
=>
array
(
'blackboard'
,
'learnwise'
),
'qformat'
=>
array
(
'blackboard'
,
'learnwise'
),
'auth'
=>
array
(
'radius'
,
'fc'
,
'nntp'
,
'pam'
,
'pop3'
,
'imap'
),
'auth'
=>
array
(
'radius'
,
'fc'
,
'nntp'
,
'pam'
,
'pop3'
,
'imap'
),
'block'
=>
array
(
'course_overview'
),
'block'
=>
array
(
'course_overview'
,
'messages'
),
'enrol'
=>
array
(
'authorize'
),
'enrol'
=>
array
(
'authorize'
),
'report'
=>
array
(
'search'
),
'report'
=>
array
(
'search'
),
'repository'
=>
array
(
'alfresco'
),
'repository'
=>
array
(
'alfresco'
),
...
@@ -1715,7 +1715,7 @@ class core_plugin_manager {
...
@@ -1715,7 +1715,7 @@ class core_plugin_manager {
'calendar_upcoming'
,
'comments'
,
'community'
,
'calendar_upcoming'
,
'comments'
,
'community'
,
'completionstatus'
,
'course_list'
,
'course_summary'
,
'completionstatus'
,
'course_list'
,
'course_summary'
,
'feedback'
,
'globalsearch'
,
'glossary_random'
,
'html'
,
'feedback'
,
'globalsearch'
,
'glossary_random'
,
'html'
,
'login'
,
'lp'
,
'mentees'
,
'messages'
,
'mnet_hosts'
,
'myoverview'
,
'myprofile'
,
'login'
,
'lp'
,
'mentees'
,
'mnet_hosts'
,
'myoverview'
,
'myprofile'
,
'navigation'
,
'news_items'
,
'online_users'
,
'participants'
,
'navigation'
,
'news_items'
,
'online_users'
,
'participants'
,
'private_files'
,
'quiz_results'
,
'recent_activity'
,
'private_files'
,
'quiz_results'
,
'recent_activity'
,
'rss_client'
,
'search_forums'
,
'section_links'
,
'rss_client'
,
'search_forums'
,
'section_links'
,
...
...
lib/db/upgrade.php
View file @
f3a3e234
...
@@ -2436,5 +2436,41 @@ function xmldb_main_upgrade($oldversion) {
...
@@ -2436,5 +2436,41 @@ function xmldb_main_upgrade($oldversion) {
upgrade_main_savepoint
(
true
,
2017082800.00
);
upgrade_main_savepoint
(
true
,
2017082800.00
);
}
}
if
(
$oldversion
<
2017091000.00
)
{
if
(
!
file_exists
(
$CFG
->
dirroot
.
'/blocks/messages/block_messages.php'
))
{
// Delete instances.
$instances
=
$DB
->
get_records_list
(
'block_instances'
,
'blockname'
,
[
'messages'
]);
$instanceids
=
array_keys
(
$instances
);
if
(
!
empty
(
$instanceids
))
{
$DB
->
delete_records_list
(
'block_positions'
,
'blockinstanceid'
,
$instanceids
);
$DB
->
delete_records_list
(
'block_instances'
,
'id'
,
$instanceids
);
list
(
$sql
,
$params
)
=
$DB
->
get_in_or_equal
(
$instanceids
,
SQL_PARAMS_NAMED
);
$params
[
'contextlevel'
]
=
CONTEXT_BLOCK
;
$DB
->
delete_records_select
(
'context'
,
"contextlevel=:contextlevel AND instanceid "
.
$sql
,
$params
);
$preferences
=
array
();
foreach
(
$instances
as
$instanceid
=>
$instance
)
{
$preferences
[]
=
'block'
.
$instanceid
.
'hidden'
;
$preferences
[]
=
'docked_block_instance_'
.
$instanceid
;
}
$DB
->
delete_records_list
(
'user_preferences'
,
'name'
,
$preferences
);
}
// Delete the block from the block table.
$DB
->
delete_records
(
'block'
,
array
(
'name'
=>
'messages'
));
// Remove capabilities.
capabilities_cleanup
(
'block_messages'
);
// Clean config.
unset_all_config_for_plugin
(
'block_messages'
);
}
upgrade_main_savepoint
(
true
,
2017091000.00
);
}
return
true
;
return
true
;
}
}
version.php
View file @
f3a3e234
...
@@ -29,7 +29,7 @@
...
@@ -29,7 +29,7 @@
defined
(
'MOODLE_INTERNAL'
)
||
die
();
defined
(
'MOODLE_INTERNAL'
)
||
die
();
$version
=
2017090
7
00.00
;
// YYYYMMDD = weekly release date of this DEV branch.
$version
=
201709
1
000.00
;
// YYYYMMDD = weekly release date of this DEV branch.
// RR = release increments - 00 in DEV branches.
// RR = release increments - 00 in DEV branches.
// .XX = incremental changes.
// .XX = incremental changes.
...
...
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