Commit 9423caee authored by catch's avatar catch
Browse files

Issue #3264633 by mstrelan, Spokje, dww, larowlan, tim.plunkett, xjm: Remove...

Issue #3264633 by mstrelan, Spokje, dww, larowlan, tim.plunkett, xjm: Remove \Drupal\layout_builder\QuickEditIntegration and refactor it so that quickedit contrib provides the integration with layout builder
parent 462e2fb7
Loading
Loading
Loading
Loading
+18 −0
Original line number Diff line number Diff line
<?php

namespace Drupal\Tests\hal\Functional\quickedit;

use Drupal\Tests\hal\Functional\layout_builder\LayoutBuilderEntityViewDisplayHalJsonAnonTest;

/**
 * @group hal
 * @group legacy
 */
class QuickEditLayoutBuilderEntityViewDisplayHalJsonAnonTest extends LayoutBuilderEntityViewDisplayHalJsonAnonTest {

  /**
   * {@inheritdoc}
   */
  protected static $modules = ['quickedit'];

}
+18 −0
Original line number Diff line number Diff line
<?php

namespace Drupal\Tests\hal\Functional\quickedit;

use Drupal\Tests\hal\Functional\layout_builder\LayoutBuilderEntityViewDisplayHalJsonBasicAuthTest;

/**
 * @group hal
 * @group legacy
 */
class QuickEditLayoutBuilderEntityViewDisplayHalJsonBasicAuthTest extends LayoutBuilderEntityViewDisplayHalJsonBasicAuthTest {

  /**
   * {@inheritdoc}
   */
  protected static $modules = ['quickedit'];

}
+18 −0
Original line number Diff line number Diff line
<?php

namespace Drupal\Tests\hal\Functional\quickedit;

use Drupal\Tests\hal\Functional\layout_builder\LayoutBuilderEntityViewDisplayHalJsonCookieTest;

/**
 * @group hal
 * @group legacy
 */
class QuickEditLayoutBuilderEntityViewDisplayHalJsonCookieTest extends LayoutBuilderEntityViewDisplayHalJsonCookieTest {

  /**
   * {@inheritdoc}
   */
  protected static $modules = ['quickedit'];

}
+1 −1
Original line number Diff line number Diff line
@@ -192,7 +192,7 @@ protected function serializeField($field, array $context, $format) {
      // @todo Replace this workaround after https://www.drupal.org/node/3043245
      //   or remove the need for this in https://www.drupal.org/node/2942975.
      //   See \Drupal\layout_builder\Normalizer\LayoutEntityDisplayNormalizer.
      if ($context['resource_object']->getResourceType()->getDeserializationTargetClass() === 'Drupal\layout_builder\Entity\LayoutBuilderEntityViewDisplay' && $context['resource_object']->getField('third_party_settings') === $field) {
      if (is_a($context['resource_object']->getResourceType()->getDeserializationTargetClass(), 'Drupal\layout_builder\Entity\LayoutBuilderEntityViewDisplay', TRUE) && $context['resource_object']->getField('third_party_settings') === $field) {
        unset($field['layout_builder']['sections']);
      }

+0 −16
Original line number Diff line number Diff line
@@ -26,7 +26,6 @@
use Drupal\Core\Session\AccountInterface;
use Drupal\Core\Access\AccessResult;
use Drupal\layout_builder\Plugin\SectionStorage\OverridesSectionStorage;
use Drupal\layout_builder\QuickEditIntegration;

/**
 * Implements hook_help().
@@ -162,12 +161,6 @@ function layout_builder_entity_view_alter(array &$build, EntityInterface $entity
  if ($display instanceof LayoutBuilderEntityViewDisplay && strpos($route_name, 'layout_builder.') === 0) {
    unset($build['#contextual_links']);
  }

  if (\Drupal::moduleHandler()->moduleExists('quickedit')) {
    /** @var \Drupal\layout_builder\QuickEditIntegration $quick_edit_integration */
    $quick_edit_integration = \Drupal::classResolver(QuickEditIntegration::class);
    $quick_edit_integration->entityViewAlter($build, $entity, $display);
  }
}

/**
@@ -351,15 +344,6 @@ function layout_builder_system_breadcrumb_alter(Breadcrumb &$breadcrumb, RouteMa
  }
}

/**
 * Implements hook_quickedit_render_field().
 */
function layout_builder_quickedit_render_field(EntityInterface $entity, $field_name, $view_mode_id, $langcode) {
  /** @var \Drupal\layout_builder\QuickEditIntegration $quick_edit_integration */
  $quick_edit_integration = \Drupal::classResolver(QuickEditIntegration::class);
  return $quick_edit_integration->quickEditRenderField($entity, $field_name, $view_mode_id, $langcode);
}

/**
 * Implements hook_entity_translation_create().
 */
Loading