workspaces.module
Same filename in other branches
File
-
core/
modules/ workspaces/ workspaces.module
View source
<?php
/**
* @file
*/
/**
* Implements hook_module_implements_alter().
*/
function workspaces_module_implements_alter(&$implementations, $hook) : void {
// Move our 'hook_entity_presave' implementation at the beginning to ensure
// that other presave implementations are aware of the changes done in
// \Drupal\workspaces\EntityOperations::entityPresave().
if ($hook === 'entity_presave') {
$implementation = $implementations['workspaces'];
$implementations = [
'workspaces' => $implementation,
] + $implementations;
// Move Content Moderation's implementation before Workspaces, so we can
// alter the publishing status for the default revision.
if (isset($implementations['content_moderation'])) {
$implementation = $implementations['content_moderation'];
$implementations = [
'content_moderation' => $implementation,
] + $implementations;
}
}
// Move our 'hook_entity_insert' implementation at the end to ensure that
// the second (pending) revision created for published entities is not used
// by other 'hook_entity_insert' implementations.
// @see \Drupal\workspaces\EntityOperations::entityInsert()
if ($hook === 'entity_insert') {
$group = $implementations['workspaces'];
unset($implementations['workspaces']);
$implementations['workspaces'] = $group;
}
}
Functions
Title | Deprecated | Summary |
---|---|---|
workspaces_module_implements_alter | Implements hook_module_implements_alter(). |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.