If 'Number of values' for field instance is set to 1, after upload of file following warnings are displayed:

Notice: Undefined index: #file_upload_delta in theme_extended_file_field_widget_multiple() (line 1275 of /var/www/drupal7/sites/all/modules/extended_file_field/extended_file_field.module).
Notice: Undefined index: #file_upload_title in theme_extended_file_field_widget_multiple() (line 1291 of /var/www/drupal7/sites/all/modules/extended_file_field/extended_file_field.module).
Notice: Undefined index: #file_upload_description in theme_extended_file_field_widget_multiple() (line 1292 of /var/www/drupal7/sites/all/modules/extended_file_field/extended_file_field.module).

Comments

MilosL’s picture

Title: Notices after file upload wenn delta set to 1 » Notices after file upload when delta set to 1
jthorson’s picture

Title: Notices after file upload when delta set to 1 » Evaluate extended_file_field widget settings for fields with cardinality = 1

Thanks for the report.

To be honest, cardinality = 1 wasn't even considered during the development of this module ... so I'm not surprised that it's throwing notices.

For the moment, I've committed a quick cardinality check to the hook_widget_file_generic_form_alter() function, so that we no longer attempt to apply multi-field widget theming to single-value fields. This should at least get rid of the notices on the edit page.

I haven't done a closer look to see if all of the logic on the field_formatter side is okay with single-value fields, so going to leave this open for now ... it appears to be looking okay based on my test site, but I'd like to take a closer look once life settles down a bit.

For now, the latest -dev version should solve the php notice issues.

jthorson’s picture

Category: Bug report » Task

  • Commit 399e6b6 on 7.x-1.x, empty-file-2150029 by jthorson:
    [#2137561] by jthorson: Fix for notices after upload when cardinality =...