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.
Backport to this issue.
Comment | File | Size | Author |
---|---|---|---|
#2 | drupal-replace_function_exists_with_is_callable-1924462-2.patch | 1.14 KB | manu manu |
#1 | drupal-replace_function_exists_with_is_callable-1924462-1.patch | 1.02 KB | bfr |
Comments
Comment #1
bfr CreditAttribution: bfr commentedHere's the patch.
Comment #2
manu manuHow about using
call_user_func()
instead of invoking directly$batch_set['finished']()
?Let's see what the testbot says...
Comment #3
manu manu...going on and marking as RTBC...
Comment #4
bfr CreditAttribution: bfr commentedcall_user_func() works, but does it bring anything to the table? I know it's much slower so I don't think we should use it without a reason. Is there something I don't see?
Comment #5
manu manuHi @bfr,
Please let me remind me the context of this issue...
I think this is because my setup (php 5.4) was screaming with static methods, or perhaps because a problem linked to:
https://www.drupal.org/node/1924420#comment-8427835
More generaly I think this was because (at lease on some php versions) callables can't be invoked directly like that.
Or maybe that's me wich is missing something?
If you need a more precise response, i will setup a reproductible test case.
Cheers