view_unpublished.install in view_unpublished 8
Same filename and directory in other branches
Contains install and update functions for view_unpublished.
File
view_unpublished.installView source
<?php
/**
* @file
* Contains install and update functions for view_unpublished.
*/
use Drupal\Core\Url;
/**
* Implements hook_install().
*/
function view_unpublished_install() {
Drupal::service('view_unpublished.install_helper')
->flagRebuild();
}
/**
* Implements hook_uninstall().
*/
function view_unpublished_uninstall() {
Drupal::service('view_unpublished.install_helper')
->flagRebuild();
// Remove any errant view_unpublished dependency.
Drupal::service('view_unpublished.install_helper')
->removeDependency();
}
/**
* Make a node access permissions rebuild needed to fix multilingual grants.
*/
function view_unpublished_update_8001() {
// We can't just rebuild all the permissions in the update batch because of
// https://www.drupal.org/node/2785155 and the ability to run updates using
// the update_free_access setting.
node_access_needs_rebuild(TRUE);
return t('A rebuild of node access permissions is necessary. Rebuilding may take some time if there is a lot of content or complex permission settings. After rebuilding has completed, content will automatically use the new permissions. <a href=":rebuild">Rebuild permissions</a>', [
':rebuild' => Url::fromRoute('node.configure_rebuild_confirm')
->toString(),
]);
}
/**
* Remove any view_unpublished dependency that may have been added to views.
*/
function view_unpublished_update_8002() {
Drupal::service('view_unpublished.install_helper')
->removeDependency();
}
Functions
Name | Description |
---|---|
view_unpublished_install | Implements hook_install(). |
view_unpublished_uninstall | Implements hook_uninstall(). |
view_unpublished_update_8001 | Make a node access permissions rebuild needed to fix multilingual grants. |
view_unpublished_update_8002 | Remove any view_unpublished dependency that may have been added to views. |