Commit message: Issue #2334405 by drunken monkey, almaudoh: Clean up documentation on Render Element classes in drupal core.

Problem/Motivation

@drunken monkey commented on #2326891-35: Convert system_element_info() to Element classes

This patch missed a lot of references to deleted functions. Mostly in comments, but form_validate_number() is also still explicitly used as a callback in NumericItemBase (apparently untested).

The attached patch would fix all of those which I could spot (using some grepping). I'm just not sure, do we have a standard for referencing methods of the same class in comments? I guess using the FQN would be overkill in this scenario? I just used the method name itself in this patch, but that should be easy enough to fix (e.g., by more grepping).

This is a follow-up to clean up the documentation on the Render Elements transferred to core by #2326891: Convert system_element_info() to Element classes.

Proposed resolution

Attached patch by @drunken monkey is transferred from #2326891-35: Convert system_element_info() to Element classes. All credit should go to him.

Remaining tasks

  • Reviews.
  • Commit.

User interface changes

None

API changes

None

Comments

jhodgdon’s picture

Status: Active » Needs work

Um. These changes do not seem like documentation fix-ups:

+++ b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/NumericItemBase.php
@@ -35,18 +35,16 @@ public function instanceSettingsForm(array $form, FormStateInterface $form_state
     $settings = $this->getSettings();
 
     $element['min'] = array(
-      '#type' => 'textfield',
+      '#type' => 'number',

Regarding the question about how to point to methods on the same class... This isn't going to work:

+++ b/core/lib/Drupal/Core/Render/Element/Select.php
+      // (see processSelect()). When this occurs, usually #empty_value is an
+      // empty string, but some forms set #empty_value to integer 0 or some

You need to at least put in the class name, like Select::processSelect() in order for it to turn into a link on api.drupal.org. And technically, we do have a policy that all references to class names in documentation should include the namespace.

The rest looks great!

almaudoh’s picture

almaudoh’s picture

Status: Needs work » Needs review
StatusFileSize
new14.52 KB
new4.19 KB

Sorry...lost the patch. Re-attached with interdiff.

jhodgdon’s picture

Status: Needs review » Fixed

Thanks! Looks good. Committed to 8.0.x.

  • jhodgdon committed 1f380d8 on 8.0.x
    Issue #2334405 by almaudoh, drunken monkey: Clean up documentation links...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.