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

Can not pass static method as finish callback in batch

$
0
0

Ex:

$batch = array();
$batch['finished'] = 'HWLoader::batchFinish';
$batch['title'] = t('Loading content');
$batch['init_message'] = t('Batch Load Starting.');
$batch['error_message'] = t('Batch Load Failed.');
$batch['file'] = drupal_get_path('module', 'highwire') . '/highwire.module';

The reason for this is because in _batch_finised() we are using function_exists which returns false for a static methods. I think is_callable should be used and then call_usr_func_array should be used to invoke the function.

Not sure if I should label this as a bug or a feature request.


Viewing all articles
Browse latest Browse all 291122

Trending Articles



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