Skip to content
GitLab
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
9a42c680
Commit
9a42c680
authored
Apr 30, 2019
by
Cecilia Vela Gurovic
Browse files
Bug 1826948: update existing comments
behatnotneeded Change-Id: I71bcdb6c98aa1382692a93db2399547e71838f19
parent
8a9170d8
Changes
2
Hide whitespace changes
Inline
Side-by-side
htdocs/lib/db/upgrade.php
View file @
9a42c680
...
...
@@ -1288,5 +1288,40 @@ function xmldb_core_upgrade($oldversion=0) {
}
if
(
$oldversion
<
2019043000
)
{
log_debug
(
'remove extra html from comment artefact descriptions'
);
// Get all the comment artefacts with the issue
$sql
=
"SELECT * FROM
{
artefact
}
WHERE artefacttype = 'comment'
AND description "
.
db_ilike
()
.
" '<!DOCTYPE%'"
;
if
(
$artefacts
=
get_records_sql_array
(
$sql
))
{
$count
=
0
;
$limit
=
1000
;
$total
=
count
(
$artefacts
);
// Loop through all of them and update the description
$dom
=
new
DOMDocument
();
$dom
->
preserveWhiteSpace
=
false
;
$dom
->
formatOutput
=
true
;
foreach
(
$artefacts
as
$artefact
)
{
$dom
->
loadHTML
(
$artefact
->
description
);
$xpath
=
new
DOMXPath
(
$dom
);
$body
=
$xpath
->
query
(
'/html/body'
);
$innerHtml
=
''
;
foreach
(
$body
->
item
(
0
)
->
childNodes
as
$child
)
{
$innerHtml
.
=
$dom
->
saveHTML
(
$child
);
}
$artefact
->
description
=
$innerHtml
;
update_record
(
'artefact'
,
$artefact
);
$count
++
;
if
((
$count
%
$limit
)
==
0
||
$count
==
$total
)
{
log_debug
(
"
$count
/
$total
"
);
set_time_limit
(
30
);
}
}
}
}
return
$status
;
}
htdocs/lib/version.php
View file @
9a42c680
...
...
@@ -16,7 +16,7 @@ $config = new stdClass();
// See https://wiki.mahara.org/wiki/Developer_Area/Version_Numbering_Policy
// For upgrades on stable branches, increment the version by one. On master, use the date.
$config
->
version
=
2019040
9
00
;
$config
->
version
=
201904
3
000
;
$config
->
series
=
'19.10'
;
$config
->
release
=
'19.10dev'
;
$config
->
minupgradefrom
=
2017031605
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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