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

juampynr created an issue. See original summary.

juampynr’s picture

Status: Active » Needs review
StatusFileSize
new943 bytes

Here is a patch that fixes it.

  • adriancid committed 2706a66 on 7.x-3.x authored by juampynr
    Issue #3100000 by juampynr, adriancid: Fix warnings on batch processing...
adriancid’s picture

Status: Needs review » Fixed

thanks

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.