Loading src/Plugin/views/field/PublishContentNode.php +2 −2 Original line number Diff line number Diff line Loading @@ -66,10 +66,10 @@ class PublishContentNode extends FieldPluginBase { return ''; } $langcode = $values->{'node_field_data_langcode'}; $langcode = $values->{'node_field_data_langcode'} ?? ''; $id = $node->id(); if ($node->isTranslatable() && isset($langcode) && $node->hasTranslation($langcode)) { if ($node->isTranslatable() && !empty($langcode) && $node->hasTranslation($langcode)) { $url = Url::fromRoute('entity.node.publish_translation', ['node' => $id, 'langcode' => $langcode]); $text = $node->getTranslation($langcode)->isPublished() ? $this->t('Unpublish (this translation)') : $this->t('Publish (this translation)'); } Loading Loading
src/Plugin/views/field/PublishContentNode.php +2 −2 Original line number Diff line number Diff line Loading @@ -66,10 +66,10 @@ class PublishContentNode extends FieldPluginBase { return ''; } $langcode = $values->{'node_field_data_langcode'}; $langcode = $values->{'node_field_data_langcode'} ?? ''; $id = $node->id(); if ($node->isTranslatable() && isset($langcode) && $node->hasTranslation($langcode)) { if ($node->isTranslatable() && !empty($langcode) && $node->hasTranslation($langcode)) { $url = Url::fromRoute('entity.node.publish_translation', ['node' => $id, 'langcode' => $langcode]); $text = $node->getTranslation($langcode)->isPublished() ? $this->t('Unpublish (this translation)') : $this->t('Publish (this translation)'); } Loading