Skip to content

RecordRTC upload fails in Questionnaire; editor missing moodle:filepickers and error toast shows literal {$a->error} #652

@Nat-Hunt

Description

@Nat-Hunt

In Moodle 4.5, using Questionnaire’s TinyMCE field to attach an audio/video recording shows a toast:
“Upload failed with error: {$a->error}” (this is due to an bug with how the error message is passed to the toast handler and is ultimately unrelated to the underlying problem)
The placeholder is not substituted, and the upload fails. Tracing shows the underlying problem is that the editor instance is initialised without file picker options, so moodle:filepickers is undefined. This prevents tiny_recordrtc from configuring the uploader and triggers the error path (which then displays the unsubstituted lang string).

Steps to reproduce:

  1. Create or edit a Questionnaire.
  2. In a TinyMCE editor field, attempt to insert an audio/video recording using the RecordRTC button.
  3. Submit/attach the recording.

Actual result:

  • Upload fails; toast reads “Upload failed with error: {$a->error}” (placeholder not replaced).
  • JS trace shows base_recorder.js → uploadFile() passes undefined options to uploader.js (around line 100).
  • tinymce.activeEditor.settings['moodle:filepickers'] is undefined.

Expected result:

  • moodle:filepickers should contain the file repository options.
  • RecordRTC should successfully save the recording into the editor’s draft file area.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions