Error message

  • Notice: Undefined property: stdClass::$preferred in _api_make_match_link() (line 1075 of /home/projects/api/www/sites/all/modules/api/api.formatting.inc).
  • Notice: Undefined property: stdClass::$preferred in _api_make_match_link() (line 1079 of /home/projects/api/www/sites/all/modules/api/api.formatting.inc).
  • Notice: Undefined property: stdClass::$preferred in _api_make_match_link() (line 1075 of /home/projects/api/www/sites/all/modules/api/api.formatting.inc).
  • Notice: Undefined property: stdClass::$preferred in _api_make_match_link() (line 1079 of /home/projects/api/www/sites/all/modules/api/api.formatting.inc).

ParagraphOperations.php

Namespace

Drupal\paragraphs\Element

File

paragraphs/src/Element/ParagraphOperations.php
View source
<?php

namespace Drupal\paragraphs\Element;

use Drupal\Core\Render\Element\Operations;
use Drupal\Core\Render\Element\RenderElement;

/**
 * {@inheritdoc}
 *
 * @RenderElement("paragraph_operations")
 */
class ParagraphOperations extends Operations {

  /**
   * {@inheritdoc}
   */
  public function getInfo() {
    return [
      '#theme' => 'links__dropbutton__operations__paragraphs',
    ] + parent::getInfo();
  }

  /**
   * {@inheritdoc}
   */
  public static function preRenderDropbutton($element) {
    $element = parent::preRenderDropbutton($element);

    // Attach #ajax events if title is a render array.
    foreach ($element['#links'] as &$link) {
      if (isset($link['title']['#ajax'])) {
        $link['title'] = RenderElement::preRenderAjaxForm($link['title']);
      }
    }
    return $element;
  }

}

Classes

Namesort descending Description
ParagraphOperations Plugin annotation @RenderElement("paragraph_operations");