For ages we are not using the word Submit for buttons any longer. The module code need to be changed. In regards to media it should mostly be Save and Upload depending on context.

http://drupal.org/update/modules/5/6#submit-to-save

Change "Submit" to "Save" on buttons

It has been agreed on that the description "Submit" for a button is not a good choice since it does not indicate what actually happens. While for example on node editing forms, "Preview" and "Delete" describe exactly what will happen when the user clicks on the button, "Submit" only gives a vague idea.

Additionally, the term "Submit" can be at times hard to translate into other languages. Since the term is used for quite different actions, this can result in inappropriate translations because it is not possible to separate two exact same strings in a translation.

When you are labeling your buttons, make sure that it is clear what this button does when the user clicks on it.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

hass’s picture

Version: 7.x-1.0-rc3 » 7.x-1.x-dev
Status: Active » Needs review
FileSize
3.04 KB

Patch attached

hass’s picture

Submit button in media lib is only a Save.

Dave Reid’s picture

When used in the Image library context, we should likely be using 'Select' and not 'Save' since nothing actually 'Saves' the field data until the users clicks Save on the node itself.

Dave Reid’s picture

Version: 7.x-1.x-dev » 7.x-2.x-dev
Priority: Major » Normal
Status: Needs review » Needs work

Changes also need to be fixed in 7.x-2.x first, then backported to 7.x-1.x as appropriate. Downgrading to normal.

hass’s picture

Status: Needs work » Needs review
FileSize
3.05 KB

Good idea. Changed button to select. It's against 1.x-DEV and fails on 2.x

hass’s picture

Patch for 2.x. Not reviewed in production as I'm running 1.x.

dddave’s picture

Status: Needs review » Needs work

It seems this patch needs a slight update. Patch won't apply.

pschuelke’s picture

Status: Needs work » Needs review
FileSize
2.6 KB

Here's an updated patch from #6

dddave’s picture

Status: Needs review » Reviewed & tested by the community

Looking good.

g10’s picture

Status: Reviewed & tested by the community » Needs work

patch from #8 breaks the upload functionality in the popup on a node form,
more specifically, the following part:

@@ -113,6 +113,10 @@ function media_browser($selected = NULL) {
         '#attributes' => array('class' => array('button', 'button-no', 'fake-cancel', $key)),
         '#weight' => 100,
       );
+      $plugin_output[$key]['form']['actions']['submit'] = array(
+        '#type' => 'submit',
+        '#value' => t('Upload'),
+      );
     }
   }

removing above lines fixes the issue

becw’s picture

Assigned: Unassigned » becw

I'm reviewing this patch.

Devin Carlson’s picture

arthurf’s picture

FileSize
3.37 KB

g10 is correct that this breaks uploading. I think this is because the upload form is being altered after drupal_get_form() is called in MediaBrowserUpload.inc If I use a normal form_alter() I'm able to change the button value properly but it does not work if it is done after the form is already built and then the value is changed.

I think the solution here is to either
* use form alter with the media upload functionality to change it
* conditionally set the value of the submit button if a submit button is not present

There is a bigger discussion about how content is delivered to the media browser is structured- is it a standard form, rendered html, should we require the save/submit/cancel buttons to be provided by the implementer? That is probably too much for this issue, but it is something that needs to be looked at.

hass’s picture

Status: Needs work » Needs review
steinmb’s picture

Assigned: becw » Unassigned
Category: Bug report » Feature request
Issue summary: View changes
Status: Needs review » Needs work
Related issues: +#1870104: Change 'Submit' button to be more explicit.
Chris Matthews’s picture

Issue tags: +Needs reroll

The 6 year old patch in #13 does not apply to the latest media 7.x-2.x-dev and if still relevant needs a reroll.

Checking patch includes/media.browser.inc...
error: while searching for:
    // This is a fairly broad assumption.
    if (empty($plugin_output[$key]['#form']) && !empty($plugin_output[$key]['#markup'])) {
      $fake_buttons = '<div class="form-actions form-wrapper">';
      $fake_buttons .= l(t('Submit'), '', array('attributes' => array('class' => array('button', 'button-yes', 'fake-submit', $key))));
      $fake_buttons .= l(t('Cancel'), '', array('attributes' => array('class' => array('button', 'button-no', 'fake-cancel', $key))));
      $fake_buttons .= '</div>';
      $plugin_output[$key]['#markup'] .= $fake_buttons;

error: patch failed: includes/media.browser.inc:81
error: includes/media.browser.inc: patch does not apply

Checking patch js/media.format_form.js...
error: js/media.format_form.js: No such file or directory

Checking patch modules/media_internet/media_internet.module...
error: while searching for:
  $form['actions'] = array('#type' => 'actions');
  $form['actions']['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Submit'),
  );
  return $form;
}

error: patch failed: modules/media_internet/media_internet.module:102
error: modules/media_internet/media_internet.module: patch does not apply
Neslee Canil Pinto’s picture

Status: Needs work » Needs review
FileSize
11.7 KB

Renamed Submit Button

Status: Needs review » Needs work

The last submitted patch, 17: rename-submit-button-1480422-17.patch, failed testing. View results

Neslee Canil Pinto’s picture

Status: Needs work » Needs review
FileSize
8.93 KB

Renamed Submit Button to Save

steinmb’s picture

Issue tags: -Needs reroll