Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 293738

Replace function_exists() with is_callable() in batch api finished callback.

$
0
0

Currently i am not able to wrap my batch operations in a class(which is very often the use case) because of this in batch.inc:
if (function_exists($batch_set['finished'])) {

If we change this to
if (is_callable($batch_set['finished'])) {

We can do this:
$batch['finished'] = array($this, 'method')

This already works with the actual batch operation callback, just not with the finished callback.

Now, i will submit patches for both 7.x and 8.x and foresee already war emerging on this, but i really hope it will be accepted, otherwise i'll have to resort to some really dirty solutions(move the function out from the class or something) and the client wont exactly buy me a champaign.


Viewing all articles
Browse latest Browse all 293738

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>