diff --git a/src/Plugin/Menu/LocalTask/PublishContentLocalTask.php b/src/Plugin/Menu/LocalTask/PublishContentLocalTask.php
index 40719e0abb..937c563c39 100644
--- a/src/Plugin/Menu/LocalTask/PublishContentLocalTask.php
+++ b/src/Plugin/Menu/LocalTask/PublishContentLocalTask.php
@@ -5,6 +5,7 @@
 use Drupal\Core\Menu\LocalTaskDefault;
 use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
 use Drupal\Core\StringTranslation\StringTranslationTrait;
+use Drupal\node\NodeInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 use Symfony\Component\HttpFoundation\Request;
 
@@ -59,8 +60,21 @@ public static function create(ContainerInterface $container, array $configuratio
    */
   public function getTitle(Request $request = NULL) {
     $langcode = $this->languageManager->getCurrentLanguage()->getId();
+
     /** @var \Drupal\node\NodeInterface $node */
-    $node = $this->nodeStorage->load($this->routeMatch->getRawParameter('node'));
+    $node = NULL;
+
+    if ($this->routeMatch->getParameters()->has('node')) {
+      $node = $this->nodeStorage->load($this->routeMatch->getRawParameter('node'));
+    }
+    else if($this->routeMatch->getParameters()->has('entity')) {
+      $entity = $this->routeMatch->getParameter('entity');
+
+      if ($entity instanceof NodeInterface) {
+        $node = $this->nodeStorage->load($entity->id());
+      }
+    }
+
     if ($node->isTranslatable() && $node->hasTranslation($langcode)) {
       $translatedNode = $node->getTranslation($langcode);
       return $translatedNode->isPublished() ? $this->config->get('unpublish_text_value') : $this->config->get('publish_text_value');
