When artefact type is set to 'video' in the database, Undefined index: video/mp4 error is shown

Bug #1722132 reported by Pat
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
High
Robert Lyon
17.04
Fix Released
High
Unassigned
17.10
Fix Released
High
Robert Lyon

Bug Description

When artefact type is set to 'video' in the database, "Undefined index: video/mp4" error is shown but when an artefact type is set to 'file' there is no error.

$validtypes = self::video_mime_types(); does not have mp4

From Robert:
1) why are we now saving mp4 as 'file' rather than 'video'
2) why does $validtypes not have 'video/mp4' as an option

Revision history for this message
Pat (pat-kira) wrote :
Robert Lyon (robertl-9)
Changed in mahara:
milestone: none → 17.10rc2
importance: Undecided → High
assignee: nobody → Robert Lyon (robertl-9)
status: New → In Progress
Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "master" branch: https://reviews.mahara.org/8107

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/8107
Committed: https://git.mahara.org/mahara/mahara/commit/e978112e5eb686fb17f02b7df3ea65783053dfd9
Submitter: Robert Lyon (<email address hidden>)
Branch: master

commit e978112e5eb686fb17f02b7df3ea65783053dfd9
Author: Robert Lyon <email address hidden>
Date: Mon Oct 9 14:29:55 2017 +1300

Bug 1722132: Video mimetype not set correctly due to fetch by assoc

Rather than fetching by array now that we have multiple extensions
using the 'video/mp4' mimetype.

This would cause problems for older sites where the file was correctly
saved as 'video' artefacttype but where the fetching from db of the
mimetypes to compare would associate a different extension to
'video/mp4', eg 'm4v'.

This also meant that videos uploaded after commit
a5cf7d59ebbd17193efaa38661eafe7b370095ee could end up being saved as
atefacttype 'file' rather than 'video'

This patch fetches mimetypes as array and tidies things up for video

behatnotneeded

Change-Id: I53dc2d5ddb573d630f1de408cc9c027e488cd99e
Signed-off-by: Robert Lyon <email address hidden>

Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "17.10_STABLE" branch: https://reviews.mahara.org/8117

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/8117
Committed: https://git.mahara.org/mahara/mahara/commit/3f4bba464cde8424d77d2de11d0bf7803840041c
Submitter: Robert Lyon (<email address hidden>)
Branch: 17.10_STABLE

commit 3f4bba464cde8424d77d2de11d0bf7803840041c
Author: Robert Lyon <email address hidden>
Date: Mon Oct 9 14:29:55 2017 +1300

Bug 1722132: Video mimetype not set correctly due to fetch by assoc

Rather than fetching by array now that we have multiple extensions
using the 'video/mp4' mimetype.

This would cause problems for older sites where the file was correctly
saved as 'video' artefacttype but where the fetching from db of the
mimetypes to compare would associate a different extension to
'video/mp4', eg 'm4v'.

This also meant that videos uploaded after commit
a5cf7d59ebbd17193efaa38661eafe7b370095ee could end up being saved as
atefacttype 'file' rather than 'video'

This patch fetches mimetypes as array and tidies things up for video

behatnotneeded

Change-Id: I53dc2d5ddb573d630f1de408cc9c027e488cd99e
Signed-off-by: Robert Lyon <email address hidden>
(cherry picked from commit e978112e5eb686fb17f02b7df3ea65783053dfd9)

Robert Lyon (robertl-9)
Changed in mahara:
status: In Progress → Fix Committed
milestone: 17.10rc2 → 17.10.0
Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "17.04_STABLE" branch: https://reviews.mahara.org/8133

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/8133
Committed: https://git.mahara.org/mahara/mahara/commit/b325885d3238cf60e5e9f1be597a10501fce9ac6
Submitter: Robert Lyon (<email address hidden>)
Branch: 17.04_STABLE

commit b325885d3238cf60e5e9f1be597a10501fce9ac6
Author: Robert Lyon <email address hidden>
Date: Mon Oct 9 14:29:55 2017 +1300

Bug 1722132: Video mimetype not set correctly due to fetch by assoc

Rather than fetching by array now that we have multiple extensions
using the 'video/mp4' mimetype.

This would cause problems for older sites where the file was correctly
saved as 'video' artefacttype but where the fetching from db of the
mimetypes to compare would associate a different extension to
'video/mp4', eg 'm4v'.

This also meant that videos uploaded after commit
a5cf7d59ebbd17193efaa38661eafe7b370095ee could end up being saved as
atefacttype 'file' rather than 'video'

This patch fetches mimetypes as array and tidies things up for video

behatnotneeded

Change-Id: I53dc2d5ddb573d630f1de408cc9c027e488cd99e
Signed-off-by: Robert Lyon <email address hidden>
(cherry picked from commit e978112e5eb686fb17f02b7df3ea65783053dfd9)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.