Commit 1f380d88 authored by jhodgdon's avatar jhodgdon

Issue #2334405 by almaudoh, drunken monkey: Clean up documentation links to...

Issue #2334405 by almaudoh, drunken monkey: Clean up documentation links to functions moved to render element classes
parent 840cd4c8
......@@ -237,7 +237,7 @@ function drupal_get_profile() {
* @return
* An array of all stored HEAD elements.
*
* @see drupal_pre_render_html_tag()
* @see \Drupal\Core\Render\Element\HtmlTag::preRenderHtmlTag()
*/
function drupal_add_html_head($data = NULL, $key = NULL) {
$stored_head = &drupal_static(__FUNCTION__, array());
......@@ -1802,7 +1802,6 @@ function drupal_get_js($scope = 'header', $javascript = NULL, $skip_alter = FALS
* browser.
*
* @see _drupal_add_js()
* @see drupal_pre_render_scripts()
*/
function drupal_merge_js_settings($settings_items) {
return NestedArray::mergeDeepArray($settings_items, TRUE);
......
......@@ -556,9 +556,8 @@ function template_preprocess_textarea(&$variables) {
* - before: The label is output before the element. This is the default.
* The label includes the #title and the required marker, if #required.
* - after: The label is output after the element. For example, this is used
* for radio and checkbox #type elements as set in system_element_info().
* If the #title is empty but the field is #required, the label will
* contain only the required marker.
* for radio and checkbox #type elements. If the #title is empty but the field
* is #required, the label will contain only the required marker.
* - invisible: Labels are critical for screen readers to enable them to
* properly navigate through forms but can be visually distracting. This
* property hides the label for everyone except screen readers.
......
......@@ -1684,8 +1684,6 @@ function drupal_pre_render_html(array $element) {
* @param array $variables
* An associative array containing:
* - page: A render element representing the page.
*
* @see system_element_info()
*/
function template_preprocess_html(&$variables) {
/** @var $page \Drupal\Core\Page\HtmlPage */
......
......@@ -338,7 +338,7 @@ protected function performRequiredValidation(&$elements, FormStateInterface &$fo
// get an additional, first empty option. In case the submitted value
// is identical to the empty option's value, we reset the element's
// value to NULL to trigger the regular #required handling below.
// @see form_process_select()
// @see \Drupal\Core\Render\Element\Select::processSelect()
elseif ($elements['#type'] == 'select' && !$elements['#multiple'] && $elements['#required'] && !isset($elements['#default_value']) && $elements['#value'] === $elements['#empty_value']) {
$elements['#value'] = NULL;
$form_state->setValueForElement($elements, NULL);
......@@ -380,9 +380,8 @@ protected function determineLimitValidationErrors(FormStateInterface &$form_stat
// by default, which is particularly useful during an Ajax submission
// triggered by a non-button. An element can override this default by
// setting the #limit_validation_errors property. For button element
// types, #limit_validation_errors defaults to FALSE (via
// system_element_info()), so that full validation is their default
// behavior.
// types, #limit_validation_errors defaults to FALSE, so that full
// validation is their default behavior.
elseif ($triggering_element && !isset($triggering_element['#limit_validation_errors']) && !$form_state->isSubmitted()) {
return array();
}
......
......@@ -68,7 +68,8 @@ public static function valueCallback(&$element, $input, FormStateInterface $form
// as unchecked. The string '0' is allowed for #return_value. The most
// common use-case for setting #return_value to either 0 or '0' is for the
// first option within a 0-indexed array of checkboxes, and for this,
// form_process_checkboxes() uses the string rather than the integer.
// \Drupal\Core\Render\Element\Checkboxes::processCheckboxes() uses the
// string rather than the integer.
return isset($input) ? $element['#return_value'] : 0;
}
}
......
......@@ -55,9 +55,9 @@ public static function processCheckboxes(&$element, FormStateInterface $form_sta
$weight = 0;
foreach ($element['#options'] as $key => $choice) {
// Integer 0 is not a valid #return_value, so use '0' instead.
// @see form_type_checkbox_value().
// @see \Drupal\Core\Render\Element\Checkbox::valueCallback().
// @todo For Drupal 8, cast all integer keys to strings for consistency
// with form_process_radios().
// with \Drupal\Core\Render\Element\Radios::processRadios().
if ($key === 0) {
$key = '0';
}
......
......@@ -132,12 +132,12 @@ public static function valueCallback(&$element, $input, FormStateInterface $form
return (isset($element['#default_value']) && is_array($element['#default_value'])) ? $element['#default_value'] : array();
}
}
// Non-multiple select elements may have an empty option preprended to them
// (see form_process_select()). When this occurs, usually #empty_value is
// an empty string, but some forms set #empty_value to integer 0 or some
// other non-string constant. PHP receives all submitted form input as
// strings, but if the empty option is selected, set the value to match the
// empty value exactly.
// Non-multiple select elements may have an empty option prepended to them
// (see \Drupal\Core\Render\Element\Select::processSelect()). When this
// occurs, usually #empty_value is an empty string, but some forms set
// #empty_value to integer 0 or some other non-string constant. PHP
// receives all submitted form input as strings, but if the empty option
// is selected, set the value to match the empty value exactly.
elseif (isset($element['#empty_value']) && $input === (string) $element['#empty_value']) {
return $element['#empty_value'];
}
......
......@@ -47,8 +47,8 @@ public function getInfo() {
),
// Properties for tabledrag support.
// The value is a list of arrays that are passed to
// drupal_attach_tabledrag(). drupal_pre_render_table() prepends the HTML
// ID of the table to each set of options.
// drupal_attach_tabledrag(). Table::preRenderTable() prepends the HTML ID
// of the table to each set of options.
// @see drupal_attach_tabledrag()
'#tabledrag' => array(),
// Render properties.
......@@ -124,9 +124,9 @@ public static function processTable(&$element, FormStateInterface $form_state, &
foreach (Element::children($element) as $key) {
$row = &$element[$key];
// Prepare the element #parents for the tableselect form element.
// Their values have to be located in child keys (#tree is ignored), since
// form_validate_table() has to be able to validate whether input (for the
// parent #type 'table' element) has been submitted.
// Their values have to be located in child keys (#tree is ignored),
// since Table::validateTable() has to be able to validate whether input
// (for the parent #type 'table' element) has been submitted.
$element_parents = array_merge($element['#parents'], array($key));
// Since the #parents of the tableselect form element will equal the
......
......@@ -141,7 +141,7 @@ public function getRegionOptions() {
* $options array.
*
* @see drupal_render()
* @see drupal_pre_render_table()
* @see \Drupal\Core\Render\Element\Table::preRenderTable()
*/
public function tablePreRender($elements) {
$js_settings = array();
......@@ -215,7 +215,7 @@ public function tablePreRender($elements) {
// If the custom #tabledrag is set and there is a HTML ID, add the table's
// HTML ID to the options and attach the behavior.
// @see drupal_pre_render_table()
// @see \Drupal\Core\Render\Element\Table::preRenderTable()
if (!empty($elements['#tabledrag']) && isset($elements['#attributes']['id'])) {
foreach ($elements['#tabledrag'] as $options) {
$options['table_id'] = $elements['#attributes']['id'];
......
......@@ -128,7 +128,7 @@ public function settingsForm(array &$form, FormStateInterface $form_state, $has_
* @param $form_state
* The current state of the form for the form this element belongs to.
*
* @see form_process_pattern()
* @see \Drupal\Core\Render\Element\FormElement::processPattern()
*/
public static function validateAllowedValues($element, FormStateInterface $form_state) {
$values = static::extractAllowedValues($element['#value'], $element['#field_has_data']);
......
......@@ -959,8 +959,9 @@ protected function installParameters() {
'pass2' => $this->root_user->pass_raw,
),
),
// form_type_checkboxes_value() requires NULL instead of FALSE values
// for programmatic form submissions to disable a checkbox.
// \Drupal\Core\Render\Element\Checkboxes::valueCallback() requires
// NULL instead of FALSE values for programmatic form submissions to
// disable a checkbox.
'update_status_module' => array(
1 => NULL,
2 => NULL,
......
......@@ -30,7 +30,7 @@ function testFormCheckbox() {
foreach (array(FALSE, NULL, TRUE, 0, '0', '', 1, '1', 'foobar', '1foobar') as $default_value) {
// Only values that can be used for array indices are supported for
// #return_value, with the exception of integer 0, which is not supported.
// @see form_process_checkbox().
// @see \Drupal\Core\Render\Element\Checkbox::processCheckbox().
foreach (array('0', '', 1, '1', 'foobar', '1foobar') as $return_value) {
$form_array = \Drupal::formBuilder()->getForm('\Drupal\form_test\Form\FormTestCheckboxTypeJugglingForm', $default_value, $return_value);
$form = drupal_render($form_array);
......
......@@ -203,7 +203,6 @@ function callback_queue_worker($queue_item_data) {
* \Drupal\Core\Render\Element\ElementInterface.
*
* @see hook_element_info_alter()
* @see system_element_info()
*/
function hook_element_info() {
$types['filter_format'] = array(
......
......@@ -14,9 +14,8 @@
* - before: The label is output before the element. This is the default.
* The label includes the #title and the required marker, if #required.
* - after: The label is output after the element. For example, this is used
* for radio and checkbox #type elements as set in system_element_info().
* If the #title is empty but the field is #required, the label will
* contain only the required marker.
* for radio and checkbox #type elements. If the #title is empty but the
* field is #required, the label will contain only the required marker.
* - invisible: Labels are critical for screen readers to enable them to
* properly navigate through forms but can be visually distracting. This
* property hides the label for everyone except screen readers.
......
......@@ -1064,7 +1064,7 @@ public function getSortName() {
* array as index. While doing that, create a container element underneath
* each option, which contains the settings related to that option.
*
* @see form_process_radios()
* @see \Drupal\Core\Render\Element\Radios::processRadios()
*/
public static function processContainerRadios($element) {
if (count($element['#options']) > 0) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment