This is similar to #519612: File Validators missing drupal_function_exists(), where I'm putting an entire CCK field (or just a D7 "Field") into a separate include file, file.field.inc. However, the #value_callback isn't getting called because that file is never included when submitting a form (oddly it does get included when building the form though). This just changes the function_exists() to drupal_function_exists() to ensure it gets pulled in and the field is assigned a value.

CommentFileSizeAuthor
form_value_callback_exists.patch1.17 KBquicksketch
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Status: Needs review » Needs work

The last submitted patch failed testing.

drewish’s picture

Status: Needs work » Reviewed & tested by the community

Super simple fix. Should we do a mass find and replace for function_exists() in core?

drewish’s picture

i guess the testbot and i cross posted... i'm going to request a retest because i'm not seeing how this would affect the image url generation.

catch’s picture

@drewish, no we shouldn't do a mass find and replace - see #528896: Small optimization to module_invoke_all() and related issues, I'd be fine with function_exists() || drupal_function_exists() as a find and replace though.

Dries’s picture

Status: Reviewed & tested by the community » Fixed

Alright, let's make form API slower! Committed to CVS HEAD. ;-)

Thanks.

quicksketch’s picture

Yeah sorry about that :-(

drupal_function_exists() and the registry is something we should be all-or-nothing about. I'd be interested in the possibility catch suggested: function_exists() || drupal_function_exists(). Let's pick it up over there in #528896: Small optimization to module_invoke_all().

Status: Fixed » Closed (fixed)
Issue tags: -Quick fix, -ImageInCore

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