Multiple warnings like these are thrown when running the node-revision-delete command:
Argument 6 passed to node_revision_delete_batch_process() must be of the type array, object given node_revision_delete.batch.inc:25 [27.4 sec, 64.44 MB] [error]
When I printed the $context argument I got the following:
DrushBatchContext Object
(
[storage:ArrayObject:private] => Array
(
[sandbox] => Array
(
[nids] => Array
(
[0] => 940936
[1] => 916941
[2] => 916956
[3] => 916961
[4] => 916951
[5] => 916916
)
[current] => 5
[total] => 6
)
[results] => Array
(
[940936] => 3
[916941] => 2
[916956] => 2
[916961] => 2
[916951] => 7
)
[finished] => 1
[message] =>
)
)
That's an ArrayObject, not an array(). Therefore, the line:
function node_revision_delete_batch_process($content_type, $minimum_revisions_to_keep, $minimum_age_to_delete, $when_to_delete, $dry_run, array &$context) {
Should not type hint the last argument to an array.
Comments
Comment #2
juampynr commentedHere is a patch that fixes it.
Comment #4
adriancidthanks