Commit 4e613637 authored by Nikita Sineok's avatar Nikita Sineok Committed by Eirik Morland
Browse files

Issue #3298312 by nikita_tt, eiriksm: The database connection is not serializable

parent 5a87955a
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
services:
  logger.channel.commerce_product_reservation:
    parent: logger.channel_base
    arguments: [ 'commerce_product_reservation' ]

  commerce_product_reservation.cart_provider:
    class: Drupal\commerce_product_reservation\CartProvider
    decorates: commerce_cart.cart_provider
@@ -9,7 +13,7 @@ services:
    class: Drupal\commerce_product_reservation\CartFormHandler
    arguments:
      - "@entity_type.manager"
      - "@logger.factory"
      - "@logger.channel.commerce_product_reservation"
      - "@messenger"
      - "@commerce_product_reservation.selected_store"
      - "@plugin.manager.reservation_store"
+6 −4
Original line number Diff line number Diff line
@@ -8,14 +8,15 @@ use Drupal\commerce_product_reservation\Exception\OutOfStockException;
use Drupal\commerce_product_reservation\Form\SelectStoreForm;
use Drupal\Core\Ajax\AjaxResponse;
use Drupal\Core\Ajax\OpenModalDialogCommand;
use Drupal\Core\DependencyInjection\DependencySerializationTrait;
use Drupal\Core\Entity\EntityTypeManagerInterface;
use Drupal\Core\Extension\ModuleHandlerInterface;
use Drupal\Core\Form\FormBuilderInterface;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Logger\LoggerChannelFactoryInterface;
use Drupal\Core\Messenger\MessengerInterface;
use Drupal\Core\StringTranslation\StringTranslationTrait;
use Drupal\Core\Url;
use Psr\Log\LoggerInterface;
use Symfony\Component\HttpFoundation\RequestStack;

/**
@@ -24,6 +25,7 @@ use Symfony\Component\HttpFoundation\RequestStack;
class CartFormHandler {

  use StringTranslationTrait;
  use DependencySerializationTrait;

  /**
   * Entity type manager.
@@ -33,7 +35,7 @@ class CartFormHandler {
  protected $entityTypeManager;

  /**
   * Logger.
   * The logger.
   *
   * @var \Psr\Log\LoggerInterface
   */
@@ -91,9 +93,9 @@ class CartFormHandler {
  /**
   * CartFormHandler constructor.
   */
  public function __construct(EntityTypeManagerInterface $entity_type_manager, LoggerChannelFactoryInterface $logger_factory, MessengerInterface $messenger, SelectedStoreManager $selected_store, ReservationStorePluginManager $reservation_manager, RequestStack $request_stack, FormBuilderInterface $form_builder, ModuleHandlerInterface $module_handler, CartAdder $cartAdder) {
  public function __construct(EntityTypeManagerInterface $entity_type_manager, LoggerInterface $logger_channel, MessengerInterface $messenger, SelectedStoreManager $selected_store, ReservationStorePluginManager $reservation_manager, RequestStack $request_stack, FormBuilderInterface $form_builder, ModuleHandlerInterface $module_handler, CartAdder $cartAdder) {
    $this->entityTypeManager = $entity_type_manager;
    $this->logger = $logger_factory->get('commerce_product_reservation');
    $this->logger = $logger_channel;
    $this->messenger = $messenger;
    $this->selectedStoreManager = $selected_store;
    $this->reservationManager = $reservation_manager;