Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
mahara
mahara
Commits
f6e9b74e
Commit
f6e9b74e
authored
Sep 11, 2015
by
Robert Lyon
Committed by
Gerrit Code Review
Sep 11, 2015
Browse files
Options
Browse Files
Download
Plain Diff
Merge "Bug 1491639: 'Group pages' block on upgrade problem"
parents
67e546c6
19247874
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
56 additions
and
2 deletions
+56
-2
htdocs/blocktype/groupviews/db/upgrade.php
htdocs/blocktype/groupviews/db/upgrade.php
+54
-0
htdocs/blocktype/groupviews/version.php
htdocs/blocktype/groupviews/version.php
+2
-2
No files found.
htdocs/blocktype/groupviews/db/upgrade.php
0 → 100644
View file @
f6e9b74e
<?php
/**
*
* @package mahara
* @subpackage blocktype-groupviews
* @author Catalyst IT Ltd
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL version 3 or later
* @copyright For copyright information on Mahara, please see the README file distributed with this software.
*
*/
defined
(
'INTERNAL'
)
||
die
();
safe_require
(
'blocktype'
,
'groupviews'
);
function
xmldb_blocktype_groupviews_upgrade
(
$oldversion
=
0
)
{
if
(
$oldversion
<
2015090300
)
{
$sql
=
"SELECT id, configdata FROM
{
block_instance
}
WHERE blocktype='groupviews'"
;
$records
=
get_records_sql_array
(
$sql
,
array
());
if
(
$records
)
{
log_debug
(
"Processing 'Group pages' blocks so they continue to display full list of pages/collections"
);
$count
=
0
;
$limit
=
500
;
$total
=
count
(
$records
);
foreach
(
$records
as
$r
)
{
$configdata
=
unserialize
(
$r
->
configdata
);
$updateconfig
=
false
;
// Do we need to update the setting for shared views
if
(
!
isset
(
$configdata
[
'showsharedviews'
])
||
$configdata
[
'showsharedviews'
]
==
1
)
{
$updateconfig
=
true
;
$configdata
[
'showsharedviews'
]
=
2
;
}
// Do we need to update the setting for shared collections
if
(
!
isset
(
$configdata
[
'showsharedcollections'
])
||
$configdata
[
'showsharedcollections'
]
==
1
)
{
$updateconfig
=
true
;
$configdata
[
'showsharedcollections'
]
=
2
;
}
if
(
$updateconfig
)
{
set_field
(
'block_instance'
,
'configdata'
,
serialize
(
$configdata
),
'id'
,
$r
->
id
);
}
$count
++
;
if
((
$count
%
$limit
)
==
0
||
$count
==
$total
)
{
log_debug
(
"
$count
/
$total
"
);
set_time_limit
(
30
);
}
}
}
}
return
true
;
}
htdocs/blocktype/groupviews/version.php
View file @
f6e9b74e
...
...
@@ -13,5 +13,5 @@
defined
(
'INTERNAL'
)
||
die
();
$config
=
new
StdClass
;
$config
->
version
=
20150
202
00
;
$config
->
release
=
'1.0.
1
'
;
$config
->
version
=
20150
903
00
;
$config
->
release
=
'1.0.
2
'
;
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