Skip to content
Snippets Groups Projects
Commit 13f781a3 authored by Trent Crawford's avatar Trent Crawford
Browse files

Fix deprecation caused by optional parameter after a mandatory parameter.

parent 87cf71b8
No related branches found
No related tags found
No related merge requests found
......@@ -158,7 +158,7 @@ function apisync_push_entity_crud_mapping(EntityInterface $entity, $op, ApiSyncM
// Enqueue async push if the mapping is configured to do so, and quit.
if ($mapping->async) {
try {
apisync_push_enqueue_async($entity, $mapping, $mapped_object, $op);
apisync_push_enqueue_async($entity, $mapping, $op, $mapped_object);
}
catch (\Throwable $e) {
\Drupal::service('event_dispatcher')->dispatch(new ApiSyncErrorEvent($e), ApiSyncEvents::ERROR);
......@@ -196,7 +196,7 @@ function apisync_push_entity_crud_mapping(EntityInterface $entity, $op, ApiSyncM
\Drupal::service('event_dispatcher')->dispatch(new ApiSyncErrorEvent($e), ApiSyncEvents::ERROR);
try {
apisync_push_enqueue_async($entity, $mapping, $mapped_object, $op);
apisync_push_enqueue_async($entity, $mapping, $op, $mapped_object);
}
catch (\Throwable $e) {
\Drupal::service('event_dispatcher')->dispatch(new ApiSyncErrorEvent($e), ApiSyncEvents::ERROR);
......@@ -223,7 +223,12 @@ function apisync_push_entity_crud_mapping(EntityInterface $entity, $op, ApiSyncM
* @param string $op
* The operation.
*/
function apisync_push_enqueue_async(EntityInterface $entity, ApiSyncMappingInterface $mapping, ?ApiSyncMappedObjectInterface $mapped_object = NULL, $op) {
function apisync_push_enqueue_async(
EntityInterface $entity,
ApiSyncMappingInterface $mapping,
string $op,
?ApiSyncMappedObjectInterface $mapped_object = NULL,
):void {
// Each mapping has its own queue, so that like entries can be easily grouped
// for batching. Each queue item is a unique array of entity ids to be
// pushed. The async queue worker loads the queue item and works through as
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment