The function book_export_traverse() accepts a callback parameter as it's second argument, however only if that callback is a standalone function yet it uses call_user_func() and should therefore accept any valid callback using the is_callable() test rather than the more restrictive function_exists().

This would allow the use of lambda functions or array style callbacks within a class.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

michaellenahan’s picture

Issue summary: View changes
FileSize
486 bytes

Here's a patch.

michaellenahan’s picture

Status: Active » Needs review
tim.plunkett’s picture

Version: 7.14 » 7.x-dev
michaellenahan’s picture

Uploading once more to see if I can trigger testbot. Thanks @tim.plunkett for setting to 7.x.

tim.plunkett’s picture

This is not relevant to Drupal 8, because the function_exists call was removed, see \Drupal\book\BookExport::exportTraverse()