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
5958125c
Commit
5958125c
authored
Oct 10, 2017
by
Robert Lyon
Committed by
Gerrit Code Review
Oct 10, 2017
Browse files
Merge "Bug 1722132: Video mimetype not set correctly due to fetch by assoc"
parents
a1d3a1dc
e978112e
Changes
3
Hide whitespace changes
Inline
Side-by-side
htdocs/artefact/file/db/upgrade.php
View file @
5958125c
...
...
@@ -467,5 +467,21 @@ function xmldb_artefact_file_upgrade($oldversion=0) {
}
}
if
(
$oldversion
<
2017100900
)
{
log_debug
(
'Update video files that may have wrong artefacttype'
);
// For video/mp4 files added after commit a5cf7d59ebbd17193efaa38661eafe7b370095ee
// They can get wrong artefact filetype if last selected was not the one with 'mp4' description
$fromsql
=
" FROM (SELECT a.id FROM
{
artefact
}
a
JOIN
{
artefact_file_files
}
aff ON aff.artefact = a.id
WHERE aff.filetype = ?
AND a.artefacttype != ?) AS foo"
;
if
(
count_records_sql
(
"SELECT COUNT(*) "
.
$fromsql
,
array
(
'video/mp4'
,
'video'
)))
{
execute_sql
(
"UPDATE
{
artefact
}
SET artefacttype = ?
WHERE id IN (
SELECT id "
.
$fromsql
.
"
)"
,
array
(
'video'
,
'video/mp4'
,
'video'
));
}
}
return
$status
;
}
htdocs/artefact/file/lib.php
View file @
5958125c
...
...
@@ -247,7 +247,7 @@ class PluginArtefactFile extends PluginArtefact {
static
$allmimetypes
=
null
;
if
(
is_null
(
$allmimetypes
))
{
$allmimetypes
=
get_records_a
ssoc
(
'artefact_file_mime_types'
);
$allmimetypes
=
get_records_a
rray
(
'artefact_file_mime_types'
);
}
if
(
is_string
(
$description
))
{
...
...
htdocs/artefact/file/version.php
View file @
5958125c
...
...
@@ -12,6 +12,6 @@
defined
(
'INTERNAL'
)
||
die
();
$config
=
new
StdClass
;
$config
->
version
=
201
6082
90
1
;
$config
->
release
=
'1.2.
7
'
;
$config
->
version
=
201
7100
90
0
;
$config
->
release
=
'1.2.
8
'
;
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