After uploading a File to a theme-settings field:
admin/appearance/settings/%theme

With a Field Something Like this:

 $form['background'] = array(
    '#type' => 'managed_file',
    '#title' => t('Background Image'),
    '#default_value' => theme_get_setting('background'),
  );

If Files undo remove is enabled, uploading a File to a managed_file field that is a standard field and not attached to an entity, will result in this Error:

Notice: Undefined index: #field_name in files_undo_remove_file_process() (line 41 of modules/files_undo_remove/files_undo_remove.module).

thanks!
david

CommentFileSizeAuthor
#1 notice-1889628-1.patch560 bytesdavidwbarratt

Comments

davidwbarratt’s picture

Status: Active » Needs review
StatusFileSize
new560 bytes

Please test the attached patch which fixes the problem.

If the module is used on a settings form, it's the same scenario as a field with a cardinality of 1. In the existing case, the function returns the element, which should be the same result in this scenario.

thanks!

swentel’s picture

Status: Needs review » Fixed

Looks good indeed, pushed and committed, thanks!

davidwbarratt’s picture

wow!

Thanks for being an awesome maintainer!

Status: Fixed » Closed (fixed)

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