Verified Commit fe5ad47f authored by Tamás Nagy's avatar Tamás Nagy
Browse files

Issue #3286348 by Project Update Bot: Automated Drupal 10 compatibility fixes

parent 14befc7e
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -7,7 +7,7 @@ namespace Drupal\brightcove_proxy\EventSubscriber;
use Brightcove\API\Client;
use Drupal\Core\Config\ConfigFactory;
use Symfony\Component\HttpKernel\KernelEvents;
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
use Symfony\Component\HttpKernel\Event\RequestEvent;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;

/**
@@ -35,10 +35,10 @@ class BrightcoveProxyInitSubscriber implements EventSubscriberInterface {
  /**
   * Initialize Brightcove client proxy.
   *
   * @param \Symfony\Component\HttpKernel\Event\GetResponseEvent $event
   * @param \Symfony\Component\HttpKernel\Event\RequestEvent $event
   *   GET response event.
   */
  public function initializeBrightcoveClientProxy(GetResponseEvent $event): void {
  public function initializeBrightcoveClientProxy(RequestEvent $event): void {
    // Initialize proxy config for Brightcove client if enabled.
    if ($this->config->get('use_proxy')) {
      Client::$proxyUserPassword = "{$this->config->get('proxy_username')}:{$this->config->get('proxy_password')}";
+13 −15
Original line number Diff line number Diff line
@@ -204,12 +204,10 @@ class BrightcoveVideo extends BrightcoveVideoPlaylistCmsEntity implements Bright
      if ($needs_save) {
        $image_content = file_get_contents($image_source);
        // Prepare directory and if it was a success try to save the image.
        if ($file_system->prepareDirectory($image_dir, FileSystemInterface::MODIFY_PERMISSIONS | FileSystemInterface::CREATE_DIRECTORY)) {
        if (!empty($image_content) && $file_system->prepareDirectory($image_dir, FileSystemInterface::MODIFY_PERMISSIONS | FileSystemInterface::CREATE_DIRECTORY)) {
          $image_name = $matches[1];
          $file = file_save_data($image_content, "{$image_dir}/{$image_name}");
          $file = $container->get('file.repository')->writeData($image_content, "{$image_dir}/{$image_name}");

          // Set image if there was no error.
          if ($file !== FALSE) {
          // Get image information for height and width.
          $image_data = $container->get('image.factory')->get($file->getFileUri());
          $height = NULL;
@@ -219,11 +217,11 @@ class BrightcoveVideo extends BrightcoveVideoPlaylistCmsEntity implements Bright
            $width = $image_data->getWidth();
          }

          // Set image.
          $this->{"set{$function}"}((int) $file->id(), $height, $width);
        }
      }
    }
    }

    return $this;
  }
+3 −3
Original line number Diff line number Diff line
@@ -4,10 +4,10 @@ declare(strict_types = 1);

namespace Drupal\brightcove\EventSubscriber;

use Symfony\Component\HttpKernel\Event\RequestEvent;
use Brightcove\API\Client;
use Drupal\Core\Extension\ModuleExtensionList;
use Symfony\Component\HttpKernel\KernelEvents;
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;

/**
@@ -35,10 +35,10 @@ class BrightcoveInitSubscriber implements EventSubscriberInterface {
  /**
   * Initialize Brightcove client proxy.
   *
   * @param \Symfony\Component\HttpKernel\Event\GetResponseEvent $event
   * @param \Symfony\Component\HttpKernel\Event\RequestEvent $event
   *   GET response event.
   */
  public function initializeBrightcoveClient(GetResponseEvent $event): void {
  public function initializeBrightcoveClient(RequestEvent $event): void {
    Client::$consumer = 'Drupal/' . \Drupal::VERSION . ' Brightcove/' . ($this->moduleExtensionList->getExtensionInfo('brightcove')['version'] ?: 'dev');
  }

+3 −3
Original line number Diff line number Diff line
@@ -4,10 +4,10 @@ declare(strict_types = 1);

namespace Drupal\brightcove\EventSubscriber;

use Symfony\Component\HttpKernel\Event\ResponseEvent;
use Drupal\brightcove\Services\SessionManagerInterface;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
use Symfony\Component\HttpKernel\KernelEvents;

/**
@@ -50,10 +50,10 @@ final class RedirectResponseSubscriber implements EventSubscriberInterface {
  /**
   * Handles ignore destination event.
   *
   * @param \Symfony\Component\HttpKernel\Event\FilterResponseEvent $event
   * @param \Symfony\Component\HttpKernel\Event\ResponseEvent $event
   *   The response event.
   */
  public function checkIgnoreDestination(FilterResponseEvent $event): void {
  public function checkIgnoreDestination(ResponseEvent $event): void {
    if ($event->getResponse() instanceof RedirectResponse) {
      $request = $event->getRequest();