From f4594cad7a56f9de61652dded746418110f9eb2d Mon Sep 17 00:00:00 2001
From: Rajab Natshah <rajabn@gmail.com>
Date: Wed, 16 Dec 2020 13:05:16 +0200
Subject: [PATCH] Issue #3188647: Change the reset timestamp for all nodes
 provided by all custom default content modules

---
 varbase.profile | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/varbase.profile b/varbase.profile
index 0622f338..007de58c 100644
--- a/varbase.profile
+++ b/varbase.profile
@@ -238,7 +238,13 @@ function varbase_assemble_extra_components(array &$install_state) {
 
   // Reset timestamp for nodes.
   $node_ids = \Drupal::entityQuery('node')->execute();
-  $batch['operations'][] = ['varbase_reset_timestamp_for_nodes', (array) $node_ids];
+  if (isset($node_ids)
+    && is_array($node_ids)
+    && count($node_ids) > 0) {
+
+    $batch['operations'][] = ['varbase_reset_timestamp_for_nodes', $node_ids];
+  }
+
 
   if (count($uninstall_components) > 0) {
     foreach ($uninstall_components as $uninstall_component) {
@@ -460,7 +466,7 @@ function varbase_uninstall_component($uninstall_component) {
 /**
  * Batch to reset timestamp for selected nodes.
  *
- * @param int|array $node_ids
+ * @param array $node_ids
  *   The Node IDs.
  */
 function varbase_reset_timestamp_for_nodes($node_ids) {
-- 
GitLab