Action failed for array_merge error, but only sometimes
-
I am running Action Scheduler (initialized via WooCommerce) and have successfully created and run numerous custom actions. In a rather complex implementation, though somewhat straightforward in terms of AS usage), I am using
as_schedule_single_actionand the identical code results in a successfully completed action for one run, but immedialy results in failure for the second.The basic code I’ve been using for the action that consistently succeeds in the one case, and consistently fails in the second is this (though I’ve experimented with several minor variations):
as_schedule_single_action( $event_date - MONTH_IN_SECONDS - ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS ), 'gbesu_tribe_events_one_month_notification', array( $event_id ), $event_id . '-bp_event_in_one_month' ) ;The logged failure is as follows:
2025-08-06 16:31:16 +0000
action failed via Admin List Table: array_merge(): Argument #1 must be of type array, null givenThe only argument being passed is listed in the Admin table as an array, and in the same manner that the successful actions based on the identical code are also listed.

I’ve looked through Action Scheduler as well as WordPress Core (WP_List_Table), and can see where the error message is generated in the former, but I can’t find what looks like a likely “array_merge” for the message anywhere, and remain mystified as to why the identical code produces failures in one place, but not in another.
The only differences between the two actions would seem extraneous to the AS actions. The arguments happen to refer to post ids.
Similarly, there are two actions being run on the same post_id, where one fails and the other succeeds.

The code that succeeds consistently looks like this:
as_schedule_single_action( $event_date - DAY_IN_SECONDS - ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS ), 'gbesu_clear_notifications', array( 'bp_event_in_one_month', $related_course_id ), $event_id . '-bp_event_in_one_month' ) ;Since I’ve been unable to isolate the exact location of an array_merge error, I’ve tried various alternatives – like running only one version, switching action titles in otherwise identical
as_schedule_single_actionfunctions, or switching the arguments arrays, without success.
At this point, I’m mystified and am running out of things to try.
You must be logged in to reply to this topic.