Skip to content
Snippets Groups Projects

issue #3305083 by Dharti Patel: PHPCS Coding Standard Issues

Merge request reports

Members who can merge are allowed to add commits.
Approval is optional
Code Quality is loading
Test summary results are being parsed

Set by to be merged automatically when the pipeline succeeds

Ready to merge by members who can write to the target branch.

Merge details

  • The source branch is 2 commits behind the target branch.
  • 2 commits and 1 merge commit will be added to .
  • Source branch will not be deleted.
  • Auto-merge enabled

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
3 3 * Drupal Entity embed plugin.
4 4 */
5 5
6 (function (jQuery, Drupal, CKEDITOR) {
6 (function (jQuery, Drupal, CKEDITOR) {
  • 6 6 * embed dialog.
    7 7 */
    8 8
    9 (function ($, Drupal, once) {
    9 (function ($, Drupal, once) {
  • 124 120
    125 121 $definition = $this->getFieldDefinition();
    126 122
    127 /* @var \Drupal\Core\Field\FieldItemListInterface $items $items */
    123 /** @var \Drupal\Core\Field\FieldItemListInterface $items $items */
  • 611 614 }
    612 615 if ($entity = $this->entityTypeManager->getStorage($entity_type)->load($id)) {
    613 616 if (!$entity->access('view')) {
    614 $form_state->setError($element, $this->t('Unable to access @type entity @id.', ['@type' => $entity_type, '@id' => $id]));
    617 $form_state->setError(
  • 638 652 }
    639 653 }
    640 654 else {
    641 $form_state->setError($element, $this->t('Unable to load @type entity @id.', ['@type' => $entity_type, '@id' => $id]));
    655 $form_state->setError(
  • 613 616 if (!$entity->access('view')) {
    614 $form_state->setError($element, $this->t('Unable to access @type entity @id.', ['@type' => $entity_type, '@id' => $id]));
    617 $form_state->setError(
    618 $element, $this->t(
    619 'Unable to access @type entity @id.',
    620 ['@type' => $entity_type, '@id' => $id]
    621 )
    622 );
    615 623 }
    616 624 else {
    617 625 if ($uuid = $entity->uuid()) {
    618 626 $form_state->setValueForElement($form['attributes']['data-entity-uuid'], $uuid);
    619 627 }
    620 628 else {
    621 $form_state->setError($element, $this->t('Cannot embed @type entity @id because it does not have a UUID.', ['@type' => $entity_type, '@id' => $id]));
    629 $form_state->setError(
  • 35 42 * The module handler service.
    36 43 * @param \Drupal\entity_embed\EntityEmbedDisplay\EntityEmbedDisplayManager $display_manager
    37 44 * The entity embed display plugin manager.
    45 * @param \Drupal\Core\Logger\LoggerChannelFactoryInterface $loggerFactory
    46 * The logger factory.
    38 47 */
    39 public function __construct(ModuleHandlerInterface $module_handler, EntityEmbedDisplayManager $display_manager) {
    48 public function __construct(ModuleHandlerInterface $module_handler,
  • 63 76 // otherwise we'll encounter a fatal error when calling
    64 77 // $this->buildEntityEmbedDisplayPlugin() further down the line.
    65 78 if (!is_array($context['data-entity-embed-display-settings'])) {
    66 \Drupal::logger('entity_embed')->warning('Invalid display settings encountered. Could not process following settings for entity type "@entity_type" with the uuid "@uuid": @settings', [
    67 '@settings' => $context['data-entity-embed-display-settings'],
    68 '@entity_type' => $entity->getEntityTypeId(),
    69 '@uuid' => $entity->uuid(),
    70 ]);
    79 $this->loggerFactory->get('entity_embed')->warning(
    • Suggested message string is wrongly formatted.

      Suggested change
      Applied
      79 $this->loggerFactory->get('entity_embed')->warning(
      80 'Invalid display settings encountered.
      81 Could not process following settings
      82 for entity type "@entity_type" with the uuid "@uuid": @settings',
      83 [
      79 $this->loggerFactory->get('entity_embed')->warning('Invalid display settings encountered. Could not process following settings for entity type "@entity_type" with the uuid "@uuid": @settings', [
    • Nikolay Shapovalov changed this line in version 10 of the diff

      changed this line in version 10 of the diff

    • Please register or sign in to reply
  • 83 100 }
    84 101
    85 102 // Allow modules to alter the entity prior to embed rendering.
    86 $this->moduleHandler->alter(["{$context['data-entity-type']}_embed_context", 'entity_embed_context'], $context, $entity);
    103 $this->moduleHandler->alter(
    104 ["{$context['data-entity-type']}_embed_context", 'entity_embed_context'],
  • 123 143 $build['#access'] = $entity->access('view', NULL, TRUE);
    124 144
    125 145 // @todo Should this hook get invoked if $build is an empty array?
    126 $this->moduleHandler->alter(["{$context['data-entity-type']}_embed", 'entity_embed'], $build, $entity, $context);
    146 $this->moduleHandler->alter(
    147 ["{$context['data-entity-type']}_embed", 'entity_embed'],
  • 1 <?php
  • 3 3 defaults:
    4 4 _controller: '\Drupal\entity_embed_test\EntityEmbedTestTwigController::idRender'
    5 5 requirements:
    6 # The access is TRUE.
  • 11 11 */
    12 12 class ViewModeFieldFormatterTest extends EntityEmbedTestBase {
    13 13
    14 /**
    15 * {@inheritdoc}
    16 */
    17 protected $defaultTheme = 'classy';
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Please register or sign in to reply
    Loading