I'm having some trouble using hook_form_alter on the IMCE upload form, and while I'm pretty sure this is a bug, it could just be me being foolish. Here is some code to ponder:

<?php
function mymodulename_form_imce_upload_form_alter(&$form, &$form_state) {
  $form['newbit'] = array(
    '#type' => 'checkboxes',
    '#title' => 'work please',
    '#options' => array('small' => 'is_small', 'large' => 'is_large'),
  );
}?>

This code works fine and, as expected, puts a couple new checkboxes on the file upload form. But when I try to alter the existing items, for example:

<?php
function mymodulename_form_imce_upload_form_alter(&$form, &$form_state) {
  $form['thumbnails']['#title'] = 'changeme';
  $form['upload']['#value'] = 'changeme';
}?>

This does nothing at all to the form. Am I just goofing something up, or do the existing forms not respond to hook_form_alter?

- Ryan

Comments

ufku’s picture

Category: bug » support
Status: Active » Fixed

try $form['fset_upload']['upload']... as the for items are wrapped by a fieldset.

Status: Fixed » Closed (fixed)

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