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.

Comments

michaellenahan’s picture

Issue summary: View changes
StatusFileSize
new486 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

StatusFileSize
new486 bytes

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()

Status: Needs review » Closed (outdated)

Automatically closed because Drupal 7 security and bugfix support has ended as of 5 January 2025. If the issue verifiably applies to later versions, please reopen with details and update the version.