Skip to content
Snippets Groups Projects
Commit 99d7e65a authored by Pavnish kumar's avatar Pavnish kumar Committed by Carsten Logemann
Browse files

Issue #3132326 by pavnish, harshit97: Link Extract Issue

parent 50571328
No related branches found
Tags 8.x-1.0-alpha1
No related merge requests found
...@@ -8,6 +8,7 @@ use Drupal\Core\DependencyInjection\DependencySerializationTrait; ...@@ -8,6 +8,7 @@ use Drupal\Core\DependencyInjection\DependencySerializationTrait;
use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Entity\EntityTypeManagerInterface;
use Drupal\Core\Messenger\MessengerTrait; use Drupal\Core\Messenger\MessengerTrait;
use Drupal\Core\StringTranslation\StringTranslationTrait; use Drupal\Core\StringTranslation\StringTranslationTrait;
use Drupal\Core\Entity\FieldableEntityInterface;
/** /**
* Helper service to handle extraction index. * Helper service to handle extraction index.
...@@ -113,9 +114,12 @@ class LinkExtractorBatch { ...@@ -113,9 +114,12 @@ class LinkExtractorBatch {
$storage = $this->entityTypeManager->getStorage($entityType->id()); $storage = $this->entityTypeManager->getStorage($entityType->id());
foreach ($ids as $id) { foreach ($ids as $id) {
$entity = $storage->load($id); $entity = $storage->load($id);
$links = $this->extractor->extractFromEntity($entity); if ($entity instanceof FieldableEntityInterface){
$this->extractor->saveLinkMultiple($links); $links = $this->extractor->extractFromEntity($entity);
$this->extractor->updateEntityExtractIndex($entity); $this->extractor->saveLinkMultiple($links);
$this->extractor->updateEntityExtractIndex($entity);
}
$numberOfProcessedItems++; $numberOfProcessedItems++;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment