I get the following error when I try to add media in a node:

Notice: Undefined index: #step in media_browser_plus_form_file_entity_add_upload_alter() (line 748 of /usr/local/web/cms-htdocs/sites/all/modules/media_browser_plus/media_browser_plus.module).

I did a var_dump of the form variable and I have no step in it:

array
  'upload' => 
    array
      '#type' => string 'managed_file' (length=12)
      '#title' => string 'Upload a new file' (length=17)
      '#upload_location' => string 'public://' (length=9)
      '#upload_validators' => 
        array
          'file_validate_extensions' => 
            array
              ...
          'file_validate_size' => 
            array
              ...
      '#progress_indicator' => string 'bar' (length=3)
      '#required' => boolean true
      '#pre_render' => 
        array
          0 => string 'file_managed_file_pre_render' (length=28)
          1 => string 'file_entity_upload_validators_pre_render' (length=40)
  'actions' => 
    array
      '#type' => string 'actions' (length=7)
      'submit' => 
        array
          '#type' => string 'submit' (length=6)
          '#value' => string 'Submit' (length=6)
  '#form_id' => string 'file_entity_add_upload' (length=22)
  '#type' => string 'form' (length=4)
  '#build_id' => string 'form-10j33hRT2Ym0PMx-CAq4OBS1l-NvK7attjpTfv1ahWE' (length=48)
  'form_build_id' => 
    array
      '#type' => string 'hidden' (length=6)
      '#value' => string 'form-10j33hRT2Ym0PMx-CAq4OBS1l-NvK7attjpTfv1ahWE' (length=48)
      '#id' => string 'form-10j33hRT2Ym0PMx-CAq4OBS1l-NvK7attjpTfv1ahWE' (length=48)
      '#name' => string 'form_build_id' (length=13)
      '#parents' => 
        array
          0 => string 'form_build_id' (length=13)
  '#token' => string 'file_entity_add_upload' (length=22)
  'form_token' => 
    array
      '#id' => string 'edit-file-entity-add-upload-form-token' (length=38)
      '#type' => string 'token' (length=5)
      '#default_value' => string 'gjOa42hgY_xrdRTBetdv9RXx4p7VpHIPC_oNzoAYi4o' (length=43)
      '#parents' => 
        array
          0 => string 'form_token' (length=10)
  'form_id' => 
    array
      '#type' => string 'hidden' (length=6)
      '#value' => string 'file_entity_add_upload' (length=22)
      '#id' => string 'edit-file-entity-add-upload' (length=27)
      '#parents' => 
        array
          0 => string 'form_id' (length=7)
  '#id' => string 'file-entity-add-upload' (length=22)
  '#method' => string 'post' (length=4)
  '#action' => string '/media/browser?render=media-popup&plugins=' (length=42)
  '#theme_wrappers' => 
    array
      0 => string 'form' (length=4)
  '#post_render' => 
    array
      0 => string 'ckeditor_link_form_post_render' (length=30)
  '#tree' => boolean false
  '#parents' => 
    array
      empty
  '#validate' => 
    array
      empty
  '#submit' => 
    array
      0 => string 'file_entity_add_upload_submit' (length=29)
      1 => string 'media_browser_form_submit' (length=25)
  '#theme' => 
    array
      0 => string 'file_entity_add_upload' (length=22)

Comments

das-peter’s picture

Status: Active » Postponed (maintainer needs more info)

#step is part of the file_entity module, if it's not present it's likely you use an incompatible version.

Please provided detail information:

  • Drupal version
  • Enabled modules and their versions
  • Used theme and its version
  • Cache settings admin/config/development/performance
    • Are caches enabled
    • Is the JavaScript or CSS aggregation enabled
  • Operation system and its version
  • Used browser
    • Version
    • Operation system and its version
    • Script error messages or console output

It's always a good idea to do complete cache flush: drush cc all or use admin/config/development/performance

plinto’s picture

Sorry about that:

Drupal version: 7.22
File Entity: 7.x-2.0-unstable7
Media: 7.x-2.0-unstable7
Theme: Adaptive Themes 7.x-3.1
I tried in Chrome (26) and Firefox (20) and got the same error

Error message:

Notice: Undefined index: #step in media_browser_plus_form_file_entity_add_upload_alter() (line 747 of /usr/local/web/cms-htdocs/sites/all/modules/media_browser_plus/media_browser_plus.module).

plinto’s picture

Status: Postponed (maintainer needs more info) » Active
das-peter’s picture

Sorry about that:

Nevermind :)

I found the issue, MBP effectively relies on the File Entity module past 2012-11-21 13:00 :|
Looks like this patch #1553114: Adding files should be a multi-step process provided the very handy '#step' item, but was committed just some days after releasing unstable7.
May I ask you to give the latest dev of file entity a try?
I'd prefer not to introduce any version dependent code in this MBP branch. At least not yet ;)

plinto’s picture

Status: Active » Closed (fixed)

Thanks, Updated media and file entity to the latest dev and the error is gone.