- Merge request !249#3155034 Delete unused missingAction() function → (Merged) created by jonathan1055
- 🇬🇧United Kingdom jonathan1055
The missingAction() function was not used, following the original MR, therefore deleted it in MR249
The Scheduler uses the following snippet to publish nodes:
// Use the standard actions system to publish and save the node.
$node = $event->getNode();
$action_id = 'node_publish_action';
if ($this->moduleHandler->moduleExists('workbench_moderation_actions')) {
// workbench_moderation_actions module uses a custom action instead.
$action_id = 'state_change__node__published';
}
$this->entityTypeManager->getStorage('action')->load($action_id)->getPlugin()->execute($node);
As you can see, it always assumes the node_publish_action
configuration action entity is present in the system (except when there is a workbench_moderation_actions module). IMHO, we should not hardcode this assumption since those actions can easily be removed if not needed. In our project, the custom scheduler tests failed since we don't have node_publish_action
and node_unpublish_action
actions installed.
Conditionally use node publish/unpublish action if present.
Fixed
2.0
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
The missingAction() function was not used, following the original MR, therefore deleted it in MR249