Commit 37be8c27 authored by Project Update Bot's avatar Project Update Bot Committed by Ismaeil ABOULJAMAL
Browse files

Issue #3298003 by Project Update Bot, Kristen Pol, izus: Automated Drupal 10 compatibility fixes

parent 28fa7552
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
<?php

use Drupal\search_api\Item\ItemInterface;
use Drupal\Core\Entity\EntityInterface;
/**
 * @file
 * Hooks provided by the "Search API attachments" module.
@@ -23,7 +25,7 @@
 * @return bool|null
 *   Return FALSE if the attachment should not be indexed.
 */
function hook_search_api_attachments_indexable($file, \Drupal\search_api\Item\ItemInterface $item, $field_name) {
function hook_search_api_attachments_indexable($file, ItemInterface $item, $field_name) {
  // Don't index files on entities owned by our bulk upload bot accounts.
  if (in_array($item->getOriginalObject()->uid, my_module_blocked_uids())) {
    return FALSE;
@@ -38,7 +40,7 @@ function hook_search_api_attachments_indexable($file, \Drupal\search_api\Item\It
 * @param \Drupal\Core\Entity\EntityInterface $entity
 *   The entity where the file was referenced in.
 */
function hook_search_api_attachments_content_extracted($file, \Drupal\Core\Entity\EntityInterface $entity) {
function hook_search_api_attachments_content_extracted($file, EntityInterface $entity) {
  // Search for nodes using media item in specific fields.
  if ($entity->getEntityTypeId() === 'media') {
    $query = \Drupal::entityQuery('node')
+1 −1
Original line number Diff line number Diff line
@@ -328,7 +328,7 @@ class TextExtractorFormSettings extends ConfigFormBase {
    $file = $this->entityTypeManager->getStorage('file')->loadByProperties($values);
    if (empty($file)) {
      // Copy the source file to public directory.
      $source = drupal_get_path('module', 'search_api_attachments');
      $source = \Drupal::service('extension.list.module')->getPath('search_api_attachments');
      $source .= '/data/search_api_attachments_test_extraction.pdf';
      copy($source, $filepath);
      // Create the file object.