Problem/Motivation
I was looking at captcha.api.php for some custom development plans on top of captcha, and I noticed that one of the examples there was for a hook_menu() implementation, which no longer exists since D8.
/**
* Implements hook_menu().
*
* Validation of the answer against the solution and other stuff is done by the
* base CAPTCHA module.
* === Recommended: hook_menu($may_cache) ===
* More advanced CAPTCHA modules probably want some configuration page.
* To integrate nicely with the base CAPTCHA module you should offer your
* configuration page as a MENU_LOCAL_TASK menu entry under
* 'admin/config/people/captcha/'.
* For our simple foo CAPTCHA module this would mean:
*/
function foo_captcha_menu($may_cache) {
$items = [];
if ($may_cache) {
$items['admin/config/people/captcha/foo_captcha'] = [
'title' => t('Foo CAPTCHA'),
'page callback' => 'drupal_get_form',
'page arguments' => ['foo_captcha_settings_form'],
'type' => MENU_LOCAL_TASK,
];
}
return $items;
}
In Drupal 8/9, this would be replaced by a configuration form class, a routing entry for it, and a task entry for the menu. None of which are Drupal hooks.
I think we can remove this example completely, to avoid possible confusion.
Proposed resolution
Remove hook_menu() example.
Remaining tasks
Remove hook_menu() example.
User interface changes
None.
API changes
None. That file serves only as a guide/documentation.
Data model changes
None. That file serves only as a guide/documentation.
Issue fork captcha-3228824
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 #3
gueguerreiroOpened a PR for this small change. Changing the priority to Minor, since this is not coding related.
Comment #4
AnybodyCorrect! RTBC'd!
Comment #7
podarokThanks