Skip to content
This repository has been archived by the owner on Jul 27, 2022. It is now read-only.

Commit

Permalink
ISAICP-5455: Temp fix for the news publication issue. (#1734)
Browse files Browse the repository at this point in the history
ISAICP-5455: Temp fix for the news publication issue.
  • Loading branch information
claudiu-cristea authored Aug 8, 2019
2 parents 67433c5 + 91d85a2 commit 3dcdf07
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 19 deletions.
17 changes: 1 addition & 16 deletions build.project.xml
Original file line number Diff line number Diff line change
Expand Up @@ -94,21 +94,6 @@

<!-- Execute Drupal updates. -->
<target name="execute-updates">
<!-- Cache might be stale with memory cache backends, such as Redis,
after a database restore. Running `drush updatedb` may give unexpected
results, for example when trying to enable modules that were enabled
prior to database restore. That's because they will be falsely reported
as "already installed". Clear the config cache bin so that updates will
run on with non-cached configuration values. -->
<drush
command="cache:clear"
assume="yes"
root="${website.drupal.dir}"
bin="${drush.bin}"
verbose="${drush.verbose}">
<param>bin</param>
<param>config</param>
</drush>
<drush
command="updatedb"
assume="yes"
Expand Down Expand Up @@ -211,7 +196,7 @@
password="${drupal.db.password}" />
</target>

<target name="restore-databases" depends="restore-apache-solr, restore-mysql-dump, virtuoso-restore-backup" />
<target name="restore-databases" depends="restore-apache-solr, restore-mysql-dump, virtuoso-restore-backup, clear-cache" />

<target name="rebuild-environment" depends="restore-databases, execute-updates" />

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@
"Do not override the default user entity view. @see https://www.drupal.org/node/2650192": "https://www.drupal.org/files/issues/properly_place_fields-2650192-4-D8.patch"
},
"drupal/publication_date": {
"Published on empty for existing nodes @see https://www.drupal.org/project/publication_date/issues/2983348": "https://www.drupal.org/files/issues/2019-07-07/2983348-19.patch",
"Published on empty for existing nodes @see https://www.drupal.org/project/publication_date/issues/2983348": "https://www.drupal.org/files/issues/2019-08-07/2983348-32.patch",
"Provide computed properties that return the publication date or the created/updated date @see https://www.drupal.org/project/publication_date/issues/3066317": "https://www.drupal.org/files/issues/2019-07-07/3066317-3.patch"
},
"drupal/rdf_entity": {
Expand Down
9 changes: 7 additions & 2 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions web/modules/custom/joinup_core/joinup_core.post_update.php
Original file line number Diff line number Diff line change
Expand Up @@ -699,3 +699,22 @@ function joinup_core_post_update_delete_orphaned_files() {
}
}
}

/**
* Reset the publication dates.
*/
function joinup_core_post_update_0_fix_publication_dates() {
// Due to an incorrect earlier version of the install hook of the
// Publication Date module a number of older news items were present without a
// publication date. Erase all publication dates and restore them.
// Note that since this update hook is prefixed with a 0 it is guaranteed to
// run before the post update hook of the Publication Date module.
$node_storage = \Drupal::entityTypeManager()->getStorage('node');
$connection = \Drupal::database();
$connection->update($node_storage->getDataTable())
->expression('published_at', PUBLICATION_DATE_DEFAULT)
->execute();
$connection->update($node_storage->getRevisionDataTable())
->expression('published_at', PUBLICATION_DATE_DEFAULT)
->execute();
}

0 comments on commit 3dcdf07

Please sign in to comment.