Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#4 | book_export_traverse-1707904-4.patch | 486 bytes | michaellenahan |
#1 | book_export_traverse-1707904-1.patch | 486 bytes | michaellenahan |
Comments
Comment #1
michaellenahan CreditAttribution: michaellenahan at erdfisch commentedHere's a patch.
Comment #2
michaellenahan CreditAttribution: michaellenahan at erdfisch commentedComment #3
tim.plunkettComment #4
michaellenahan CreditAttribution: michaellenahan at erdfisch commentedUploading once more to see if I can trigger testbot. Thanks @tim.plunkett for setting to 7.x.
Comment #5
tim.plunkettThis is not relevant to Drupal 8, because the function_exists call was removed, see \Drupal\book\BookExport::exportTraverse()