Created
August 9, 2021 17:04
-
-
Save szeidler/c06464484507ed7d8dff5633c9b12188 to your computer and use it in GitHub Desktop.
Adds a update hook for issue https://www.drupal.org/project/publication_date/issues/3066446
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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