Skip to content

Duplicate Video Token in Migration #1266

Open
@dennis531

Description

@dennis531

Version
main

Describe the bug
The random token generation tries to set the same token for all videos in

$db->exec('UPDATE oc_video SET token = LOWER(SUBSTRING(MD5(RAND()), 1, 12))

Also, generating tokens in this way may cause collisions, and not just in this particular location.

To Reproduce
Steps to reproduce the behavior:

  1. Install plugin version 3 on a system with plugin version 2
  2. See the following exception
SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'd4e466ef1544' for key 'token'

Expected behavior
The migration should set a distinct token for each video.

Metadata

Metadata

Assignees

Labels

priority:hightype:bugv:3Everything related to the Stud.IP Opencast Plugin Version 3.x

Type

No type

Projects

Status

Planned

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions