The widget doesn't work as expected on multiple value field

Created on 3 November 2022, over 1 year ago
Updated 6 April 2023, about 1 year ago

Problem

When recording an audio file on a field that can accept multiple values.

After you record the first audio, the second record button is not available. You need to save the entity first then go back to the edit page to be able to record the second audio.

πŸ› Bug report
Status

Needs work

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡¦Ukraine Oleksiy Lutsk πŸ‡ΊπŸ‡¦

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States adamfranco

    I tried testing this patch on empty installations of Drupal 9.5.7 and 10.1.x-dev and neither works successfully in the default Claro theme.

    The default multiple-file-upload UI in D9 & D10 uses an upload widget and then adds the uploaded files to a sortable table:

    When the Audio Recorder widget is used in D10 instead of the default file widget the first audio file is recorded, but it is never shifted to a sortable table and there is not a mechanism to add a second recording:

    This behavior is the same as without this patch in D10.

    In D9 in contrast, the first recording is saved and then the UI dissapears and a second recording can be made, but there is no indication of the first recording existing:

    Without this patch in D9 the behavior is that the single file is recorded and then left in place with no option to add another (similar to the D10 state with or without this patch).

    I haven't dived into the default File widget to understand how it works and which parts would be good to override or re-implement in the audio-recorder widget to get a similar behavior with multiple recordings with just the actual upload part (and file link-vs-audio-player) replaced.

  • πŸ‡ΊπŸ‡ΈUnited States adamfranco
  • πŸ‡ΊπŸ‡ΈUnited States adamfranco

    In addition to other possible changes, it is likely that FileWidget::formMultipleElements() and FileWidget::processMultiple() will need to be overridden to support recording multiple audio files.

Production build 0.69.0 2024