In the contact.module there are the following documentation comments.
/**
* Implements hook_form_FORM_ID_alter().
*
* Add the enable personal contact form to an individual user's account page.
*
* @see \Drupal\user\ProfileForm::form()
*/
/**
* Implements hook_form_FORM_ID_alter().
*
* Add the default personal contact setting on the user settings page.
*
* @see \Drupal\user\AccountSettingsForm
*/
/**
* Form submission handler for user_admin_settings().
*
* @see contact_form_user_admin_settings_alter()
*/
function contact_form_user_admin_settings_submit($form, FormStateInterface $form_state) {
\Drupal::configFactory()->getEditable('contact.settings')
->set('user_default_enabled', $form_state->getValue('contact_default_status'))
->save();
}The description should say for which form the hook implementation or the form submission handler is, as the examples on Drupal API documentation standards for functions / Form-generating functions and Drupal API documentation standards for functions / Hook implementation show. Since form builders are now classes, the description cannot reference a function, which is no longer exist in Drupal 8+.
Issue fork drupal-3461741
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
avpadernoComment #3
sourav_paulComment #5
sourav_paulComment #6
avpadernoThe line that has been changed is already correct. What needs to be changed is Form submission handler for user_admin_settings().
Comment #7
avpadernoAlso, there are more comments which needs to be changed, in that file. Let's expand the issue to those comments too.
Comment #8
sourav_paulComment #9
smustgrave commentedGoing to mark it as this does help. Only one I was iffy about is
seems like it's not needed since it's a form submission handler.
Comment #10
avpaderno@smustgrave Saves the contact page setting. could be removed. I left it because the short description already used it, but it is not necessary, given the code used from that hook.
Comment #11
quietone commentedI can not find a coding standard that support this statement. If someone can point that out, add a link here.
Comment #12
avpadernoComment #13
avpadernoComment #14
avpadernoComment #15
quietone commented@apaderno, thanks for taking the time to update the issue summary directing readers to the standards.
This is certainly an improvement. It does raise the question of if updating these docs for these functions should be done throughout core so we are sure everything is updated.
I intend to commit this within 24 hours.
Comment #18
quietone commentedCommitted to 11.x and 11.0.x Thanks for the improvement!
Comment #19
quietone commentedComment #20
quietone commented