Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save szeidler/c06464484507ed7d8dff5633c9b12188 to your computer and use it in GitHub Desktop.
Save szeidler/c06464484507ed7d8dff5633c9b12188 to your computer and use it in GitHub Desktop.
diff --git a/publication_date.install b/publication_date.install
index df9495a..b9090b0 100755
--- a/publication_date.install
+++ b/publication_date.install
@@ -34,3 +34,19 @@ function _publication_date_update_existing() {
->from($nids)
->execute();
}
+
+/**
+ * Set the Tuesday, January 19, 2038 values for unpublished content to NULL.
+ */
+function publication_date_update_8001(&$sandbox) {
+ $query = \Drupal::database()->update('node_field_data');
+ $query->fields(['published_at' => NULL]);
+ $query->condition('published_at', 2147483647);
+ $query->execute();
+
+ $query = \Drupal::database()->update('node_field_revision');
+ $query->fields(['published_at' => NULL]);
+ $query->condition('published_at', 2147483647);
+ $query->execute();
+}
+
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment