Commit 9bee4588 authored by catch's avatar catch
Browse files

Issue #2311393 by tim.plunkett: Remove hook_element_info() and all references to it

parent d66acd16
Loading
Loading
Loading
Loading
+2 −2
Changes for core/includes/common.inc: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -1200,7 +1200,7 @@ function show(&$element) {
 * Retrieves the default properties for the defined element type.
 *
 * @param $type
 *   An element type as defined by hook_element_info().
 *   An element type as defined by an element plugin.
 *
 * @deprecated in Drupal 8.0.0, will be removed before Drupal 9.0.0.
 *   Use \Drupal::service('element_info')->getInfo() instead.
@@ -1213,7 +1213,7 @@ function element_info($type) {
 * Retrieves a single property for the defined element type.
 *
 * @param $type
 *   An element type as defined by hook_element_info().
 *   An element type as defined by an element plugin.
 * @param $property_name
 *   The property within the element type that should be returned.
 * @param $default
+1 −1
Changes for core/lib/Drupal/Core/Render/Element/MachineName.php: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -135,7 +135,7 @@ public static function processMachineName(&$element, FormStateInterface $form_st
    );
    // A form element that only wants to set one #machine_name property (usually
    // 'source' only) would leave all other properties undefined, if the defaults
    // were defined in hook_element_info(). Therefore, we apply the defaults here.
    // were defined by an element plugin. Therefore, we apply the defaults here.
    $element['#machine_name'] += array(
      'source' => array('label'),
      'target' => '#' . $element['#id'],
+1 −4
Changes for core/lib/Drupal/Core/Render/ElementInfoManager.php: 1 added line, 4 removed lines.
Original line number Diff line number Diff line
@@ -110,10 +110,7 @@ protected function buildInfo($theme_name) {
    }

    // Otherwise, rebuild and cache.
    // @todo Remove this hook once all elements are converted to plugins in
    //   https://www.drupal.org/node/2311393.
    $info = $this->moduleHandler->invokeAll('element_info');

    $info = [];
    foreach ($this->getDefinitions() as $element_type => $definition) {
      $element = $this->createInstance($element_type);
      $element_info = $element->getInfo();
+1 −3
Changes for core/lib/Drupal/Core/Render/ElementInfoManagerInterface.php: 1 added line, 3 removed lines.
Original line number Diff line number Diff line
@@ -44,8 +44,6 @@ interface ElementInfoManagerInterface {
   *   - #title_display: optional string indicating if and how #title should be
   *     displayed (see form-element.html.twig).
   *
   * @see hook_element_info()
   * @see hook_element_info_alter()
   * @see \Drupal\Core\Render\Element\ElementInterface
   * @see \Drupal\Core\Render\Element\ElementInterface::getInfo()
   */
@@ -55,7 +53,7 @@ public function getInfo($type);
   * Retrieves a single property for the defined element type.
   *
   * @param string $type
   *   An element type as defined by hook_element_info().
   *   An element type as defined by an element plugin.
   * @param string $property_name
   *   The property within the element type that should be returned.
   * @param $default
+1 −1
Changes for core/lib/Drupal/Core/Render/RendererInterface.php: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -148,7 +148,7 @@ public function renderPlain(&$elements);
   *     $pre_bubbling_cid.
   *   - If this element has #type defined and the default attributes for this
   *     element have not already been merged in (#defaults_loaded = TRUE) then
   *     the defaults for this type of element, defined in hook_element_info(),
   *     the defaults for this type of element, defined by an element plugin,
   *     are merged into the array. #defaults_loaded is set by functions that
   *     process render arrays and call the element info service before passing
   *     the array to Renderer::render(), such as form_builder() in the Form
Loading