Audio Recorder Widget provides a field widget for file-fields that uses the vmsg HTML5/JavaScript library for in-browser audio recording.

See Middlebury's name-pronunciation documentation for an example of how this field widget can be used.

Project link:

https://www.drupal.org/project/audiorecorder

Comments

adamfranco created an issue. See original summary.

vishal.kadam’s picture

Thank you for applying! Reviewers will review the project files, describing what needs to be changed.

Please read Review process for security advisory coverage: What to expect for more details and Security advisory coverage application checklist to understand what reviewers look for. Tips for ensuring a smooth review gives some hints for a smoother review.

To reviewers: Please read How to review security advisory coverage applications, What to cover in an application review, and Drupal.org security advisory coverage application workflow.

While this application is open, only the user who opened the application can make commits to the project used for the application.

Reviewers only describe what needs to be changed; they don't provide patches to fix what reported in a review.

vishal.kadam’s picture

Status: Needs review » Needs work

1. There seems to be inconsistency in the drupal core requirement.

FILE: composer.json

"drupal/core": "^9 || ^10",

FILE: audiorecorder.info.yml

core_version_requirement: ^8.8 || ^9 || ^10

FILE: modules/audiorecorder_webform_integration/audiorecorder_webform_integration.info.yml

core_version_requirement: ^8.8 || ^9 || ^10

2. There is no need to duplicate comments for the inherited method. Use {@inheritdoc}.

FILE: src/Element/AudioFileRecorder.php

  /**
   * Render API callback: Expands the managed_file element type.
   *
   * Expands the file type to include Upload and Remove buttons, as well as
   * support for a default value.
   */
  public static function processManagedFile(&$element, FormStateInterface $form_state, &$complete_form) {

FILE: src/Plugin/Field/FieldWidget/AudioRecorderWidget.php

  /**
   * Form API callback: Processes a file_audio_recorder field element.
   *
   * Expands the file_audio_recorder type to include the max_recording_time.
   *
   * This method is assigned as a #process callback in formElement() method.
   */
  public static function process($element, FormStateInterface $form_state, $form) {
  /**
   * Form API callback. Retrieves the value for the file_generic field element.
   *
   * This method is assigned as a #value_callback in formElement() method.
   */
  public static function value($element, $input, FormStateInterface $form_state) {

FILE: modules/audiorecorder_webform_integration/src/Element/WebformAudioRecorderFileElement.php

  /**
   * Processes a 'webform_example_element' element.
   */
  public static function processManagedFile(&$element, FormStateInterface $form_state, &$complete_form) {
  /**
   * Webform element validation handler for #type 'webform_example_element'.
   */
  public static function validateManagedFile(&$element, FormStateInterface $form_state, &$complete_form) {

3. If a class does not need those methods, there is no need to implement them.

FILE: modules/audiorecorder_webform_integration/src/Element/WebformAudioRecorderFileElement.php

  /**
   * Webform element validation handler for #type 'webform_example_element'.
   */
  public static function validateManagedFile(&$element, FormStateInterface $form_state, &$complete_form) {
    // Here you can add custom validation logic.
  }

4. Remove commented code.

FILE: modules/audiorecorder_webform_integration/src/Plugin/WebformElement/WebFormAudioRecorderFileElement.php [Line no: 52]

// '#default_value' => $this->getSetting('max_recording_time'),

adamfranco’s picture

Status: Needs work » Needs review

Thanks for the review, @vishal.kadam! I've updated the 1.x branch with fixes to each of the items you pointed out.

I left one of comments in place because it isn't a direct copy of the parent function's doc and explains more about it's particulars:

FILE: src/Plugin/Field/FieldWidget/AudioRecorderWidget.php

/**
   * Form API callback: Processes a file_audio_recorder field element.
   *
   * Expands the file_audio_recorder type to include the max_recording_time.
   *
   * This method is assigned as a #process callback in formElement() method.
   */
  public static function process($element, FormStateInterface $form_state, $form) {

The others have been converted to {@inheritdoc}.

vishal.kadam’s picture

@adamfranco,

I have reviewed the changes, and they look fine to me.

Let’s wait for other reviewers to take a look and if everything goes fine, you will get the role.

Thanks

avpaderno’s picture

Assigned: Unassigned » avpaderno
Status: Needs review » Reviewed & tested by the community

Thank you for your contribution! I am going to update your account.

These are some recommended readings to help with excellent maintainership:

You can find more contributors chatting on the Slack #contribute channel. So, come hang out and stay involved.
Thank you, also, for your patience with the review process.
Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.

I thank all the reviewers.

avpaderno’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.