\Drupflare\Anachron\Drupal\Extension LegacyElementInfoTypes

Gives `hook_element_info_alter()` the Drupal 7 element types that Drupal 11 dropped.

Drupal 7 modules edit $types['styles']['#pre_render'] without checking that the type exists, and array_unshift() on the missing key is a TypeError. Each Drupal 7 core type that Drupal 11 does not register is added as an empty stub for the length of the alter and removed afterwards, because nothing in Drupal 11 renders those types. A stub an implementation changed is recorded as refused, so the loss is data.

Summary

Methods
Properties
Constants
stub
drop
No public properties found
D7_TYPES
No protected methods found
No protected properties found
No protected constants found
No private methods found
No private properties found
LISTS

Constant

D7_TYPES

D7_TYPES = ['form', 'page', 'ajax', 'html_tag', 'styles', 'scripts', 'submit', 'button', 'image_button', 'textfield', 'machine_name', 'password', 'password_confirm', 'textarea', 'radios', 'radio', 'checkboxes', 'checkbox', 'select', 'weight', 'date', 'file', 'tableselect', 'item', 'hidden', 'value', 'markup', 'link', 'fieldset', 'vertical_tabs', 'container', 'actions', 'token', 'text_format', 'managed_file', 'contextual_links', 'user_profile_category', 'user_profile_item', 'field_ui_table']

The element types Drupal 7 core and its core modules registered.

LISTS

LISTS = ['#pre_render', '#post_render', '#process', '#after_build', '#element_validate', '#theme_wrappers']

The callback lists a Drupal 7 alter appends to.

Methods

stub()

stub(array  $info) : list<string>

Adds an empty stub for every Drupal 7 type the info lacks.

Parameters

array $info

The element info, edited in place.

Returns

list —

The types that were stubbed.

drop()

drop(array  $info, list  $stubbed) : void

Removes the stubs, recording each one an implementation changed.

Parameters

array $info

The element info, edited in place.

list $stubbed

The types stub() added.

Returns

void —