I've found this issue with the updated drupal sites of us, when the theme_file_icon function was called without specified the alt property, it throws notice - as i see the icon_directory can throw the same problem.
I'm attaching my solution as a patch here.
The issue where it was changing: #2163209: Add alternate text to file icon

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

tatarbj created an issue. See original summary.

Status: Needs review » Needs work

The last submitted patch, make-alt-and-icon_directory-properties-really-optionals_1.patch, failed testing.

David_Rothstein’s picture

Status: Needs work » Postponed (maintainer needs more info)

I can't reproduce any problem here - theme('file_icon', array('file' => file_load(1))) works fine for me with no PHP notices (assuming there's an actual file on the site with ID = 1).

That's because the default values of these variables are defined in hook_theme() (see http://cgit.drupalcode.org/drupal/commit/?id=830fdea).

Did you forget to run update.php (or at least clear caches) after updating your site to the latest Drupal core version?

tatarbj’s picture

Hi @David_Rothstein,
i've checked our cluster and actually because we still using 7.39 with only the security updates from the last two versions of drupal (don't ask why...), the changes are not applied there, maybe it is the reason why i realised this issue on our systems. The message was this: Notice: Undefined index: alt in theme_file_icon() (line 800 of /.../modules/file/file.module). This message was pointing to the first usage of $variables['alt'] that's why when i've checked the code i thought it can be the solution, but you're right because it is already defined in hook_theme() it shouldn't be an issue.

pfrenssen’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

@tatarbj thanks for the clarification!