Skip to content

Commit

Permalink
Reverted broken unpublish translation code.
Browse files Browse the repository at this point in the history
  • Loading branch information
kepol committed Jan 7, 2024
1 parent e72e3a4 commit f7d1073
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions src/Seed.php
Original file line number Diff line number Diff line change
Expand Up @@ -249,13 +249,8 @@ public static function seedTaxonomyTerm($entity, $langcode = NULL) {
\Drupal::service('event_dispatcher')->dispatch(new QuantRedirectEvent("/taxonomy/term/{$tid}", $defaultUrl, 301), QuantRedirectEvent::UPDATE);
}

// Handle case where translation is unpublished.
// Unpublish if necessary.
$published = $entity->isPublished();
if ($entity->hasTranslation($langcode)) {
$translation = $entity->getTranslation($langcode);
$published = $translation->isPublished();
}

if ($published) {
\Drupal::service('event_dispatcher')->dispatch(new QuantEvent($markup, $url, $meta, NULL, $entity, $langcode), QuantEvent::OUTPUT);
}
Expand Down Expand Up @@ -333,13 +328,8 @@ public static function seedNode(EntityInterface $entity, $langcode = NULL) {
}
}

// Handle case where translation is unpublished.
// Unpublish if necessary.
$published = $entity->isPublished();
if ($entity->hasTranslation($langcode)) {
$translation = $entity->getTranslation($langcode);
$published = $translation->isPublished();
}

if ($published) {
\Drupal::service('event_dispatcher')->dispatch(new QuantEvent($markup, $url, $meta, $rid, $entity, $langcode), QuantEvent::OUTPUT);
}
Expand Down

0 comments on commit f7d1073

Please sign in to comment.