In core/modules/locale/locale.batch.inc we have the $options argument optional, but it comes before $context which is a mandatory argument.
We should make $options so it is not optional.
function locale_translation_batch_status_check($project, $langcode, array $options = array(), &$context) {
This was discussed while making updates to the documentation in the locale module:
Comments
Comment #1
jamesdixon commentedI should note the documentation block for this function should be changed to reflect the new order of arguments.
Comment #2
alexpottWe can't do this the context argument is added by the batch system which is why it is impossible for options to optional.
Comment #3
alexpottMore information: locale_translation_batch_status_check is used as a batch operation in
_locale_translation_batch_status_operations- batch operations have the batch context pass in as a the final agrument in_batch_process()- specifically:That array_merge() means that batch operations can not have optional arguments.
Comment #4
jamesdixon commented@alexpott: You're right, sorry I misunderstood your comment in the documentation issue. I've renamed this issue title and changed the summary to reflect your recommendation.
Comment #5
alexpottPerhaps we can then just fix this in the other issue?
Comment #6
jamesdixon commentedSounds good, I'll fix it up in the other issue and change the other issues component.